Broken Permalinks – WordPress

Screenshot showing an error. Pushing failed. The response is not a valid JSON response

Do you know that feeling when you change something on your website, then go to test it and find – it has broken everything? Then you go back to what you changed and you cannot remember what is was before!!

I was following a tutorial where they showed you how to change your Permalinks – 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 – but none of the other pages would load.

I tried to add a new page, but got the error below. Well it is valid. Nothing has changed. I haven’t touched any JSON.

Pushing failed. The response is not a valid JSON response

I realised the problem was my Permalinks which I had just changed, following the tutorial. Went back to fix them – but could not remember what they used to be.

The Permalinks resulting from clicking PostName in the bullet list.

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.

I have now figured out this error is probably due to some setting. Unfortunately I don’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.

The following two are valid settings. So hello future self. This is how you solve it.

  • /index.php/%year%/%monthnum%/%day%/%postname%/
  • /index.php/%postname%/
A screenshot showing the permalinks that work
By prefixing my selection with /index.php, I was able to solve the problem and have the structure I preferred.

Leave a Reply

Your email address will not be published. Required fields are marked *