{"id":341,"date":"2021-02-20T13:08:16","date_gmt":"2021-02-20T13:08:16","guid":{"rendered":"http:\/\/meatpie\/?p=341"},"modified":"2021-02-28T06:08:28","modified_gmt":"2021-02-28T06:08:28","slug":"broken-permalinks-wordpress","status":"publish","type":"post","link":"https:\/\/snersbots.co.uk\/index.php\/broken-permalinks-wordpress\/","title":{"rendered":"Broken Permalinks &#8211; WordPress"},"content":{"rendered":"\n<p>Do you know that feeling when you change something on your website, then go to test it and find &#8211; it has broken everything? Then you go back to what you changed and you cannot remember what is was before!!<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>I was following a tutorial where they showed you how to change your Permalinks &#8211; thanks LinkedIn. After that every time I tried to go to a blog post, I got a 404. I could ping the website, load the main page &#8211; but none of the other pages would load.<\/p>\n\n\n\n<p>I tried to add a new page, but got the error below. Well it is valid. Nothing has changed. I haven&#8217;t touched any JSON. <\/p>\n\n\n\n<p class=\"has-text-align-center has-pale-pink-background-color has-background\"><strong>Pushing failed. The response is not a valid JSON response<\/strong><\/p>\n\n\n\n<p>I realised the problem was my Permalinks which I had just changed, following the tutorial. Went back to fix them &#8211; but could not remember what they used to be. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/meatpie\/wp-content\/uploads\/2021\/02\/Permalinks-broken.png\" alt=\"\" class=\"wp-image-352\" width=\"887\" height=\"281\" srcset=\"https:\/\/snersbots.co.uk\/wp-content\/uploads\/2021\/02\/Permalinks-broken.png 887w, https:\/\/snersbots.co.uk\/wp-content\/uploads\/2021\/02\/Permalinks-broken-300x95.png 300w, https:\/\/snersbots.co.uk\/wp-content\/uploads\/2021\/02\/Permalinks-broken-768x243.png 768w\" sizes=\"auto, (max-width: 887px) 100vw, 887px\" \/><figcaption>The Permalinks resulting from clicking PostName in the bullet list.<\/figcaption><\/figure>\n\n\n\n<p>After a lot of searching I found a setting that I could paste in that fixed the problem. But I still wanted to be able to use Postname instead of the default setting. <\/p>\n\n\n\n<p>I have now figured out this error is probably due to some setting. Unfortunately I don&#8217;t host the site, so it is tricky making changes on the server. But it can be solved by simply prefixing your preference with \/index.php.<\/p>\n\n\n\n<p>The following two are valid settings. So hello future self. This is how you solve it.<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<ul class=\"wp-block-list\"><li><code>\/index.php\/%year%\/%monthnum%\/%day%\/%postname%\/<\/code><\/li><li><code>\/index.php\/%postname%\/<\/code><\/li><\/ul>\n<\/div><\/div>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"239\" src=\"http:\/\/meatpie\/wp-content\/uploads\/2021\/02\/Fixed-permalinks-1024x239.png\" alt=\"A screenshot showing the permalinks that work\" class=\"wp-image-344\" srcset=\"https:\/\/snersbots.co.uk\/wp-content\/uploads\/2021\/02\/Fixed-permalinks-1024x239.png 1024w, https:\/\/snersbots.co.uk\/wp-content\/uploads\/2021\/02\/Fixed-permalinks-300x70.png 300w, https:\/\/snersbots.co.uk\/wp-content\/uploads\/2021\/02\/Fixed-permalinks-768x179.png 768w, https:\/\/snersbots.co.uk\/wp-content\/uploads\/2021\/02\/Fixed-permalinks.png 1033w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>By prefixing my selection with \/index.php, I was able to solve the problem and have the structure I preferred.<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Do you know that feeling when you change something on your website, then go to test it and find &#8211; it has broken everything? Then you go back to what you changed and you cannot remember what is was before!!<\/p>\n","protected":false},"author":1,"featured_media":346,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[17,18,16],"class_list":["post-341","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computers","tag-permalinks","tag-the-response-is-not-a-valid-json-resonse","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=341"}],"version-history":[{"count":15,"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/341\/revisions"}],"predecessor-version":[{"id":379,"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/341\/revisions\/379"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/media\/346"}],"wp:attachment":[{"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/snersbots.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}