How to Fix “Update Failed. The response is not a valid JSON response”

Did you just come across the “Update failed. The response is not a valid JSON response.” Error working in WordPress block editor?

⚠️ This is a common WordPress error that appears on your website due to reasons like plugin and theme conflict, SSL certificate or mixed content issue, .htaccess file corruption, etc.

It’s frustrating to encounter the JSON response error. It doesn’t tell you why it’s occurring or how to remove it – it’s forcing you to drop everything you’re doing and find a way to remove the error from your website.

What causes the message “Update failed. The response is not a valid JSON response.” Error? 💣

When you upload an image or publish or update a post on your WordPress site, WordPress transmits the request to your web server. The server responds in JSON format.

If for some reason the server doesn’t respond in JSON format or not at all, WordPress returns “The response is not a valid JSON response”. errors.

You must be asking yourself: what is causing the miscommunication or lack of communication between your website and the server?

The answer is that there is more than one cause. It could be a bug in a plugin or theme, an issue with the SSL certificate, .htaccess file corruption, a REST API conflict, etc.

In the next section, we will examine these causes and find out which cause led to the error on your website.

But before we move on to the next section, it’s worth noting that WordPress is showing different variations of the same JSON error.

  • You see this variation when trying to update a post: “Update failed. The response is not a valid JSON response.”
  • This appears when you try to publish a post: “Failed to publish. The response is not a valid JSON response.”
  • And a simple “The response is not a valid JSON response.” Uploading an image gives an error.

ℹ️ No matter which variant you see, the solutions are the same.

How to fix “The response is not a valid JSON response”. mistake 🔨

Since we don’t know what’s causing the error on your site, it’s best to try different solutions.

But before we begin, backup your entire WordPress site.

In this tutorial, you need to make changes to your website. It’s a risky business. It can damage your website. If something goes wrong, a backup will help you get the site back to normal. Therefore, you must create a backup of your WordPress site before proceeding.

🔧 Now let’s start with the solutions:

Generate a new .htaccess file to fix permalink issues

One of the most common causes of the JSON error is a problem with your website’s .htaccess file or permalinks.

In order to remove the error from your website, you need to update your website’s permalinks, which you can achieve in two ways.

The easiest way is to force WordPress to generate a new .htaccess file from your WordPress dashboard.

Go to Settings → permanent link. On the permalink page, scroll down and click save Changes Button.

Permalink page on WordPress
On the Permalink Settings page, scroll down and click the Save Changes button

Now go back to your editor and check if the error is gone.

Do you still see the error? Then there is another solution that you can try before moving on to the next method. You can completely delete your existing .htaccess file and then let WordPress create a new one:

1. Install FileZilla, an FTP client on your desktop. Here is a guide to installing FileZilla.

2. Open FileZilla and connect it to your website. This guide will show you how to make that connection.

3. Next go to public_html and locate them .htaccess File.

4. Right-click and select the file Download to save a copy on your local computer. This serves as a backup in case you need it.

5. Once you have the backup, right click on the file and select it Extinguish button to delete the file.

Delete Htacess file in Filezilla
Right-click the .htacess file and choose Delete

6. Open your WordPress dashboard and go to Settings → permanent link. On the permalink page, scroll down and click save Changes Button. This will force WordPress to create a new .htaccess file.

👉 This should remove the error from your site if caused by .htaccess/permalink issues. If not, try the following solutions.

Check your WordPress site address settings

The JSON response error may appear because your website addresses are not configured correctly on the Settings page.

To set things right go to Settings → General and you should be able to see the following two boxes:

  1. WordPress address (URL)
  2. Site address (URL)

Make sure your website url is inserted in both fields. Both URLs must be identical. And they should Start with HTTPSnot HTTP (as long as you have an SSL certificate installed).

Then save your changes.

Even if you don’t make any changes on the page, be sure to click save Changes Button.

WordPress address and site address - update failed.  The response is not a valid JSON response.
Make sure both URLs are the same and precede HTTPS

Fix mixed content warnings/issues

Nowadays all websites should use an SSL certificate, which allows you to use the HTTPS connection on your website.

However, if you are migrating an older website from HTTP to HTTPS, you could end up in a situation where some older resources are still loaded over HTTP instead of HTTPS. This can trigger what is known as a mixed content warning, which can result in an invalid JSON response error.

In the previous section, you made sure that both the WordPress address and the site address start with HTTPS. This might have already fixed the mixed content issue. But just to be on the same page Install and activate this plugin: Really simple SSL.

After installation you should see a popup with this button: Enable SSL! Click the button. The plugin will work and you log out. Don’t worry. Just login and check if the JSON error is gone in your Gutenberg editor.

If you need help setting up the plugin, take a look at this guide.

really easy SSL plugin activation - update failed.  The response is not a valid JSON response.
Click the Enable SSL button to move all links to HTTPS

Disable plugins and themes to find conflicts

Theme and plugin conflicts are a common cause of WordPress errors. So in this section we will help you to find out if a theme or plugin is causing the JSON response error on your website.

First, a little disclosure: Disabling the plugins and themes can break your site. You could lose some of your configurations. But if you have a backup, that’s no problem.

After disabling the plugins and themes and figuring out which plugin or theme is causing the error, you can bring your website back to normal. Then delete the culprit theme or plugin from your website. That way, all your configurations remain intact and the culprit is gone.

Now go to Appearance → Themes and Enable the default WordPress theme (like Twenty Twenty, Twenty Twenty One, etc.). Check if the JSON error is resolved.

If the error is gone, then delete the theme. If not, reactivate your previous design.

Next go to Installed plugins, Select all your plugins and select under Bulk Actions Deactivate and hit Use.

disable all plugins - update failed.  The response is not a valid JSON response.
Disable all plugins and check if the JSON error is gone

If the error doesn’t appear in your Gutenberg editor, it was caused by one of your plugins. All you have to do is find out which of the plugins is the culprit. Start reactivation the plugins one by one. Every time you reactivate a plugin, check if the JSON error was returned.

When you find the culprit, Delete plugin. If it is an essential part of your website, contact the plugin developer and ask for help.

Other Ways to Fix Invalid JSON Response Error.

The first four solutions should allow you to get rid of the “Updating failed. The response is not a valid JSON response.” but if it persists, try the following methods:

Check for REST API conflicts

WordPress uses the REST API to communicate with the server. When the communication fails for some reason, the JSON error occurs.

To know if the REST API is the cause of the problem, open your Gutenberg editor, which shows the JSON error. right click on the error and select the Test Possibility.

Chrome browser inspection option - update failed.  The response is not a valid JSON response.
Click the Check button and look for a REST API error

Among consolesearch for one REST API error. If you find it, the error is caused by the API.

To fix the error you must Searching for help from your hosting provider.

Upload images in other ways

If uploading images to your post throws the error, try uploading them via the media library.

Make sure you don’t use invalid characters in the title. Just use English letters and numbers in the title of the picture.

Switch to classic editor (temporarily or permanently)

If all else fails, consider switching to the Classic editor. All you have to do is Install the official Classic Editor plugin.

For more information, see our guide on disabling Gutenberg and using the classic TinyMCE editor.

However, if you prefer to use the Gutenberg editor, you need to find a way to remove the JSON response error from your website.

👉 If you’ve tried all the solutions listed above and still can’t fix the error, then you need professional help. Contact your hosting provider and tell them about all the solutions you tried. They will help you fix the error.

Fix WordPress “Invalid JSON Response” error for good

That “Update failed. The response is not a valid JSON response.” Error is one of the most common WordPress errors. It can appear when you upload an image or publish/update some content using the new block editor (Gutenberg).

The real cause could be anything from a rogue plugin or theme to an SSL certificate issue. To remove the error, you just need to find out the reason behind it and remove it from your website.

We hope that with the help of our tutorial you were able to remove the JSON response error from your website.

For more tips on troubleshooting common WordPress errors, check out our Beginner’s Guide to Troubleshooting WordPress. 😎

Leave a Reply

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

Verified by MonsterInsights