You create some posts on your websites, and the output is not updated correctly, resulting in the error message “Update failed”. Error message: The response is not a valid JSON response.” This is one of the most common and frustrating errors WordPress users and developers face on their websites.
In 2018, WordPress revamped its classic editor and replaced it with its new counterpart Gutenberg (Block). Since then, users have predominantly seen the message “Update failed. The response is not a valid JSON response.”
You may receive invalid JSON errors for a variety of reasons. This article discusses the most common causes and provides solutions to work around the problem.
#1 Reset Permalink
A typical solution to the “Updating failed: response is not a valid JSON response” error is to revise your Permalink structure. You can reset it by navigating to Settings > Permalinks in the Dashboard.
Then click Save Changes to update the current structure. Afterward, check to see if the error has disappeared. If not, return to Permalink and select Plain under Custom Settings to update it. If you are not sure you have chosen the correct settings, select one of the available default structures.
Then select Save Changes and recheck to see if the error is fixed. If it persists, you can try all the other structures. Focus on one problem; you want to have the error fixed.
#2 Go Back to Classic Editor
Many users can solve the updating problem by temporarily forgetting about Gutenberg and returning to the Classic editor. However, you need to install and activate its plugin on your WordPress website to do so.
Remember, though, that when you use the Classic Editor, the new Block Editor will be replaced by the old Classic Editor. This replacement may adversely affect the formatting and properties of your current content that you previously created with the Block Editor.
#3 Control Themes and Plugins
When you use too many plugins on your WordPress websites (> 40), the possibility of interference between them increases, leading to response errors.
But it’s not only the number of plugins you should pay attention to. Rather, some plugin files can cause JSON errors on your web pages.
So, to avoid plugin conflict, you need to deactivate all plugins on your web pages. By including “Health Check & Troubleshooting”, you can stop the backend plugins while the frontend remains unchanged for your visitors.
If the invalid JSON response error disappears when you disable all plugins, one of them triggers the error. Now enable the plugins one by one and track down the problematic plugins.
#4 WordPress REST API conflict
The WordPress admin backend has implemented the REST API to connect to the server. If this API is disrupted, WordPress won’t be able to communicate with the server and will display the JSON error.
You can try editing and saving one of your blogs to determine if the REST API is causing the problem. If the JSON error occurs, right-click and select Inspect to open Chrome’s Dev Tools.
Check if you see a REST API error under the Console tab. If it does, the problem is with REST API.
The solution is to inform and ask your web host, as the server mainly causes REST API errors. If you are using a caching plugin like LiteSpeed Cache, you should disable the setting to cache REST API and save the content again.
#5 Regenerate WordPress .htaccess File
WordPress uses the .htaccess as a configuration file to manage SEO-friendly URLs. Typically, it can regenerate and update the file automatically. You can also do this manually by clicking the Save Changes button at the bottom of the Settings page > permalinks.
However, sometimes the file is not updated correctly or has incorrect settings, which affects your WordPress Permalinks and causes an invalid JSON response error.
If you don’t set up the .htaccess file correctly, some required WordPress URLs may become inaccessible.
#6 Find the Text Segment Causing the JSON Error
Sometimes the error occurs when you prepare your content in another tool, for example, Google Docs, and copy it to the WordPress editor. To fix the error, you may consider copying and pasting one section (or paragraph) at a time rather than the entire post at once.
After finding the paragraph causing the invalid JSON error, copy and paste each sentence individually. Once you find the cause, type it in the WordPress editor instead of copying and pasting.
Computer errors, in general, can be very frustrating even for competent programmers. And imagine you are a beginner and try to fix such WordPress errors yourself; you will break the website 100%.
That’s why it’s better to let an expert fix the invalid JSON response.