How to Fix the “Updating Failed. The Response is Not a Valid JSON Response” Error

How to Fix the "Updating Failed. The Response is Not a Valid JSON Response" Error

Did you encounter the “updating failed the response is not a valid JSON response” error on your WordPress website? 🤔

It’s a common WordPress error but not a critical one. In most cases, it does not prevent you from accessing your website but can prevent you from getting on with your work.

The error typically appears when uploading a media file or editing content in the native WordPress Block Editor or Site Editor (AKA Gutenberg). To continue using the editor, you need to remove the error.

So in this article, we will show you how to remove the “updating failed the response is not a valid JSON response” error from your WordPress website. 🧹

📚 Table of contents:

  1. Refresh permalinks & generate a new .htaccess file
  2. Check your site’s URLs
  3. Fix mixed content problems (HTTPS issues)
  4. Disable firewalls
  5. Deactivate plugins and themes to find potential compatibility issues
  6. Check the debug log
  7. Seek help from hosting provider

What causes the “updating failed the response is not a valid JSON response” error?

As we said in the introduction, the JSON response error appears when you are using the Block Editor and/or Site Editor to upload an image or to add or modify your website’s content.

To understand the error, you need to first understand what happens behind the scenes when using the editor.

When working in the editor, your browser is constantly communicating with your website’s server.

As you add or modify content on Gutenberg, your site’s data is sent to the server. It processes the data, stores it in the database, and responds to the editor saying that the data has been saved.

The “updating failed the response is not a valid JSON response” error appears when something goes wrong with this communication between the editor and site server.

😕 The miscommunication between an editor and server is usually triggered by the following causes:

  • Plugin or theme conflicts
  • Incorrect server configurations
  • Corrupted data
  • Security plugin restrictions
  • firewall restrictions, among other things

In the next section, we are going to show some troubleshooting steps to help you remove the “updating failed the response is not a valid JSON response” from your Gutenberg Editor.

How to fix the “updating failed the response is not a valid JSON response” error

In this section, we have covered all the possible solutions to the error. But before you start implementing the solutions, we recommend taking a backup of your entire website.

Some of the solutions involve going to the backend of your site and making modifications to important WordPress files, disabling plugins, themes, etc.

Needless to say, these steps are risky.

With a backup in place, you can implement the solutions without worrying about crashing your website.

So take a backup before you proceed with the solutions below. 💾

To fix the “updating failed the response is not a valid JSON response” error, you need to implement the following solutions:

Temporary solutions if you must get something done right away

Implementing some of the common solutions can be a time-consuming affair, so if you are in a hurry and you absolutely must add/edit a piece of content right away, we recommend using these solutions for the time being and then carrying out the real solutions later.

1. Switch to Classic Editor

If you had been planning to switch to the Classic Editor permanently, this could be your cue. If you have no such plans, then just use the Classic Editor temporarily for the piece of content where you’re having issues.

That said, making the switch may impact the layout and formatting of your existing pages created using the Block Editor, so we don’t recommend switching to the Classic Editor sitewide if possible.

To switch to the Classic Editor, install and activate the official Classic Editor plugin on your WordPress website.

2. Upload media via the Media Library

If you encountered the “Updating Failed the Response is Not a Valid JSON Response” error while uploading an image directly in the editor, try adding the image via your site’s Media Library instead.

On your WordPress dashboard, go to Media → Add New Media File and hit the Select Files button to upload the image from your local computer.

add new media file.

Once you’ve uploaded the media file via this interface, you can select it from inside the block editor. For example, you can add an Image block and then select the option to choose an existing image from your Media Library.

Permanent solutions for the WordPress invalid JSON response error

Since we don’t know the exact reason why the error appeared on your website, we have listed all the possible solutions. But that doesn’t mean you need to implement all the solutions.

Just implement one solution at a time and keep checking whether it removes the error from your website. If it doesn’t, then implement the next solution.

Let’s get started. 🏁

Problems with your SEO-friendly URL structure are also known to cause the “Updating Failed the Response is Not a Valid Json Response” error on your WordPress website.

To fix the URL structure issue, you need to open your WordPress dashboard and go to Settings → Permalinks, scroll down to the end of the page, and hit the Save Changes button.

You don’t need to change any settings; clicking the button alone can sometimes fix the problem.

refreshing wordpress permalinks - Updating Failed the Response is Not a Valid Json Response.refreshing wordpress permalinks - Updating Failed the Response is Not a Valid Json Response.

Once done, check if that removed the invalid JSON response error. If not, then you need to generate a new .htaccess file. Here’s how:

Open your hosting account and go to cPanel → File Manager.htaccess. You can also connect to your server using FTP.

Right-click on the file and hit the Download button to store a copy of the file on your local computer as a backup to be used if required. Next, right-click again and hit the Delete button.

deleting htaccess file in file manager.deleting htaccess file in file manager.

Then, open your WordPress dashboard and go to Settings → Permalinks. Scroll down and hit the Save Changes button.

Return to the public_html folder, and you should be able to see a new .htaccess file inside the folder.

Now check if the “Updating Failed the Response is Not a Valid JSON Response” error still appears on your website.

Are you still seeing the error? No worries, try the next solution. 👇

2. Check your site’s URLs

Another common cause of JSON error is having incorrect Site URLs in your WordPress settings.

We recommend checking your Settings page by opening your WordPress dashboard and going to Settings → General.

You will be able to see these two fields: WordPress Address (URL) and Site Address (URL).

They should contain the URL of your website.

The URL in WordPress Address is what visitors use to find your website. The Site Address indicates the location of your website files. In most cases, both of these URLs are the same.

Ensure that the URLs in these fields are proper. No misspellings and the HTTPS (assuming your website has an SSL certificate installed) appears before the website URLs.

If you modify the WordPress and Site address, be sure to hit the Save Changes button.

wordpress and site addresses - Updating Failed the Response is Not a Valid Json Response.wordpress and site addresses - Updating Failed the Response is Not a Valid Json Response.
3. Fix mixed content problems (HTTPS issues)

Mixed content problems typically appear after installing an SSL certificate into the website.

Before installation of the certificate, your website was being served over HTTP. After installing the certificate and configuring your site to use HTTPS, your website is served over HTTPS.

However, some pages could still be loading over HTTP leading to a mixed content problem and that could have triggered the “updating failed the response is not a valid JSON response” error on the Gutenberg Editor.

In the previous step, we asked you to ensure that the WordPress and Site Addresses have HTTPS before the URLs. In the vast majority of situations, that should take care of the mixed content issue. But if it didn’t then install and activate this plugin: Really Simple SSL.

After activation, a pop-up will appear with an Activate SSL button. Hit that button and the plugin will ensure that all your pages are loading over HTTPS.

4. Disable firewalls

🛡️ Security firewalls are known to interfere with the Block Editor’s communication with the website server.

So we recommend disabling the firewall and checking if the JSON error still appears in the editor.

Firewalls are added to a website using a CDN or a security plugin. Some hosting providers also offer firewall services for websites hosted on their servers. Be sure to check with your hosting provider to ensure all firewalls are disabled on your WordPress website.

5. Deactivate plugins and themes to find potential compatibility issues

Conflict between plugins and themes is also known to cause the “updating failed the response is not a valid JSON response” error.

Disable your current theme by going to Appearance → Themes and activating Twenty Twenty-Four or some other WordPress theme.

switching to default wordpress theme - Updating Failed the Response is Not a Valid Json Response.switching to default wordpress theme - Updating Failed the Response is Not a Valid Json Response.

If that doesn’t remove the error, then navigate to PluginsInstalled Plugins and proceed to disable all the plugins installed on your website.

If the problem goes away after disabling your plugins, you can reactivate them one by one until you find the exact plugin that’s causing issues.

6. Check the debug log

For more advanced users, the WordPress debug log can provide some insights into what might be triggering the “Updating Failed the Response is Not a Valid Json Response” message.

To access the debug log, you need to add a code snippet to the site’s wp-config.php file. To edit the wp-config.php file, you need to access your site’s files directly using FTP or something like cPanel File Manager.

To access the wp-config file, open your hosting account and go to cPanelFile Manager.

file manager in the cpanel.file manager in the cpanel.

Locate the public_html folder on the left side of the screen, select it, and wp-config.php should appear on the right side of the screen.

editing wp-config in file manager.editing wp-config in file manager.

Right-click on the files and select the Edit button. Insert the following code before this sentence: “Stop editing! Happy blogging”

define( 'WP_DEBUG', true ); 
define( 'WP_DEBUG_LOG', true );

Hit the Save button.

👉 For more details, we have a whole post on turning on debugging in WordPress.

debugging code snippet in wpconfig.debugging code snippet in wpconfig.

Next, go back to the public_html folder and open the wp-content folder. You should see a file called debug.log inside this folder. Open the file and check for clues related to the JSON error.

7. Seek help from hosting provider

Does the error still show up? 🐞

In that case, you need to seek out help from your hosting support team. They should be able to offer insights into the problem and recommend solutions.

Fix the WordPress invalid JSON response error for good 🚧

The “updating failed the response is not a valid JSON response” error is a common WordPress error. It usually appears in the Block Editor or Site Editor while you are adding or modifying content or media.

There are two quick and easy solutions to this problem. You can switch to the Classical Editor or upload media files directly into the Media Library. But these are only temporary solutions. Using the Gutenberg Editor again could cause the error to reappear.

👉 Here are some better solutions:

  • Refresh permalinks
  • Check your site’s URL on the Settings page
  • Fix mixed content problems
  • Disable firewalls
  • Deactivate plugins and themes
  • Check your debug log to find the real cause of the error
  • Seek help from the hosting provider, if all else fails

For some more general tips for fixing WordPress issues, you also might be interested in our full guide to WordPress debugging, as well as a more advanced debugging guide.

Do you have any questions about the WordPress invalid JSON response error? Let us know in the comment section below.

Was this article helpful?

No

Thanks for your feedback!

Keep reading the article at WPShout. The article was originally written by Sufia Banu on 2024-01-02 10:42:36.

The article was hand-picked and curated for you by the Editorial Team of WP Archives.

Disclosure: Some of the links in this post are "affiliate links." This means if you click on the link and purchase the product, We may receive an affiliate commission.

Leave a Comment

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

Show Your ❤️ Love! Like Us
Scroll to Top