How to fix “not a valid JSON response” errors
March 18, 2022 | Tips & Tricks, Troubleshooting, WordPress
Sometimes when trying to save changes to a WordPress site (usually a post or a page) you may encounter an error that reads “Updating failed. The response is not a valid JSON response.”
If you are an external build partner and you receive this error, please open a Technical Clarification and set the Clarification Type to Internal Tools Needed.
Internal builders can proceed with the steps below.
When this occurs, it is usually due to a firewall. When this is the GoDaddy Website Firewall from Sucuri we can fix this issue by whitelisting some file paths in the Website Security settings. To do this, complete the following steps:
- Access the firewall settings in the customer’s Website Security account from MYA by clicking on the “Details” link beneath “Firewall”
- You should now be on the Firewall dashboard. Click on the “Settings” tab.
- Next click the “Access Control” tab.
- Click “Allow URL Paths” in the left sidebar.
- Add four URL paths. For each of the URL paths listed below you will need to add the URL path to the text box, select “Begins with” from the dropdown and click the “Allow” button.
wp-json/wp/v2/pages
wp-json/wp/v2/post
wp-json/wp/v2/users
wp-json/wp/v2/media
Once you have added all four URL paths the issue should be resolved and you should be able to save changes again.
If you are still having issues after adding the above URL paths you may have success by adding the following additional URL paths:
/wp-json/wp/v2/users
/wp-json/wp/v2/posts/
You can also look at your browser developer console to look for a specific URL path that is being blocked.