How I fixed the WordPress JSON error – updating failed

Lately I’ve been seeing this message while trying to post or edit sites using the Gutenberg editor –

ERROR Updating failed. Error message: The response is not a valid JSON response.

Digging around the common solution seemed to be changing the Permalinks structure that forms your URL structure in WordPress. This just didn’t work for me. I tried multiple permutation combinations to no avail.

Another solution I came across and also tried was setting the memory limit in the WordPress Config file. But this didn’t’ help.

To be honest, while webmastering content I was essentially copy pasting the formatted text from Word into WordPress. I thought that perhaps this was the problem and pasted plain text and formatted it manually. What this lead me to discover was that inserting any kind of hyperlinked URL generated the JSON error while publishing.

The first solution that worked was switching back to the classic editor by installing that as a plugin. Using this you can also allow a person to toggle between editors. But whenever you pick the Gutenberg editor it doesn’t work. And I did want to try to get to know and work with this new block editor. So I continued digging.

What solved this error was a comment I found on a discussion board. Basically I had to whitelist a URL in my firewall to get this working. The magic URL being.

/wp-json/wp/v2

This got it working for me. I hope it helps someone else to fix this.

I’ve had a lot of people connecting with me on Facebook hoping I can help them solve this bug. Sadly each use case is different. What I can tell you is that this is for a live site – not something running locally on a virtual server.

How to whitelist your URL will vary depending on your hosting service provider and its security options. In Go Daddy this was under Website Security Deluxe > Manage > Firewall Details > Settings > Access Control > Allow URL Paths.

If you find this article helpful do give it a share and have a look at my other articles too! Thanks.