Updating Failed. The Response is Not a Valid JSON Response

So you’re editing a post in WordPress. You hit Update, and…bam! “Updating Failed. The Response is Not a Valid JSON Response.”

No warning, no help, just a message that sounds like it came from a robot (it did). What does it even mean? And why now?

I’ve seen this error show up on brand-new sites and old ones alike. It can come from a permalink glitch, a broken plugin, or even something weird with your SSL setup. Sometimes it’s your theme. Other times it’s your server or host. WordPress doesn’t tell you much. So I will.

In this post, I’ll walk through every fix I know that works – starting with the simple stuff and moving to the deeper issues.

Key Takeaways

  • Reset your permalinks and regenerate your .htaccess file to restore proper REST API routes and resolve broken update requests.
  • Ensure your WordPress and Site Address URLs are correct and use HTTPS if SSL is enabled, to prevent blocked or misrouted API calls.
  • Temporarily disable plugins and switch themes to identify conflicts that might be corrupting the JSON response during post updates.

What is this error about, really?

In most cases, the error occurs when WordPress fails to get a proper response from the server when saving or updating your blog content. In other words, you’re working on a post, try to save it but can’t.

When dealing with the block editor specifically, WordPress communicates with your server in the background via the REST API, expecting to receive JSON data.

However, if the response is missing or malformed (for example, due to a server error or a blocked request), the editor will show this JSON error message (“Updating failed. The response is not a valid JSON response.”) instead of saving your post.

The good news is that there are a couple of fixes you can do to get rid of that error:

“Why would my permalinks be broken?” – you’re asking. Sure, you haven’t done anything to break them, but there are still a couple of things that might be happening.

Chiefly, the permalinks can be altered by third-party plugin settings or site updates. There’s nothing bad or tricky going on; it’s just that you might have to reset your permalinks from time to time. This simple action restores the right settings in the WordPress database.

In fact, misconfigured permalinks are one of the most common causes of the JSON response error.

Why this causes the error? CLICK

The block editor’s save request is sent to an endpoint like /wp-json/.... Broken permalinks can make that URL invalid (resulting in a 404 or other non-JSON response). WordPress struggles to connect with your server properly when permalink rules aren’t working, leading to the JSON error.

All you do to fix it is go to Settings → Permalink, scroll down and hit the Save Changes button. Yes, you’re not actually changing any settings – just reconfirming what’s already there.

permalinks

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

2. Generate a new .htaccess file

On Apache servers, WordPress uses a file called .htaccess to define URL rewrite rules for your permalinks (learn more about that file here). If htaccess has the wrong rules or wasn’t updated properly, the REST API endpoints may not resolve, causing the “invalid JSON response” error.

In short, a bad .htaccess can break your permalinks and the REST API altogether.

To fix this, you’ll need to regenerate a fresh .htaccess with the correct rules. Now, this sounds a bit intimidating perhaps, but WordPress can actually do this automatically. Here’s how to get it done:

First, delete the current .htaccess file. To do that, connect to your website via FTP. This guide will help you do that if you’re not sure how.

Go to the main folder where your WordPress installation is kept and simply delete the .htaccess file.

deleting htacess file in filezilla

Next, regenerate the .htaccess file. For this, simply jump back into the permalinks settings again and reset them. Go to Settings → Permalink in your WordPress dashboard. Scroll down and click the Save Changes button. This will force WordPress to create a new .htaccess file.

3. Check your WordPress site address settings

Most sites shouldn’t be suffering from this issue. However, just to be sure, it’s important to check that your WordPress Address (URL) and Site Address (URL) settings are configured correctly. If these URLs are wrong; for example, pointing to your old domain (after domain changes), subfolder, or not correctly assigned to HTTP/HTTPS protocol, then this can disrupt the REST API and cause the JSON error.

Why this causes the error? CLICK

The block editor uses the site’s base URL to call the REST API. If WordPress is configured with an address that doesn’t match your actual site URL, the editor might be making requests to the wrong location. This could result in a failure to connect or a redirect. For instance, if one URL is http and the site is actually on https, the browser may block the request as an SSL security issue, or the REST endpoint might redirect…either case returns no valid JSON to the editor.

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

  • WordPress Address (URL)
  • Site Address (URL)

Make sure your website URL is correct in both fields – both URLs have to be identical. And they should start with HTTPS, not HTTP (as long as you’ve installed an SSL certificate).

Even if you don’t make any changes on the page, be sure to hit the Save Changes button.

wordpress address and site address

4. Fix “mixed content” warnings/problems with SSL

Speaking of SSL, we should also cover the other most common issue with certificates on WordPress websites…

If your website recently added SSL or is trying to serve content over HTTPS, “mixed content” issues can lead to the JSON error. Mixed content means some resources are loading over HTTP on an HTTPS page. Modern browsers will often block these insecure requests for security reasons. If the blocked resource is the REST API call itself (or a script that fetches data), WordPress may end up with no data or a partial response…hence “not a valid JSON response.”

Why this causes the error? CLICK

The block editor, when loaded over HTTPS, expects to communicate securely. If your WordPress configuration or content still loads something via HTTP (e.g. the REST endpoint URL, or maybe an image in a block that triggers an issue), the browser might prevent it. As a result, the editor’s update request never truly hits the server or comes back incomplete. This scenario is common if you enabled SSL but didn’t update your site URLs, or if some URLs in your content/themes/plugins are hard-coded to http.

To fix this, you’ll need to reinstall SSL on your site or reset the settings. Either way, the steps are similar.

👉 Note; if any of the below sounds too complicated, check out our detailed guide on how to install SSL on WordPress.

First off, make sure that your server provides SSL certificates and that you have one installed (assigned to) your domain. If no, enable the certificate. This is usually done through cPanel, via a simple interface screen – just a couple of clicks.

Once you are sure that the certificate is there, install the Really Simple Security plugin for easy integration. Note; this plugin is not required, but it makes it a lot simpler to make sure that your WordPress can cooperate with SSL without problems.

After installing you should see a popup with this button: Activate SSL! Click on the button. The plugin will set to work and log you out. Don’t worry. Just login in and check if the JSON error is gone. It’s also a good idea to clear all caches in case you have caching enabled on your site.

really simple ssl plugin activation

5. Look for security plugins interfering

Sometimes security measures can block WordPress’ REST API calls. If you have a security plugin (e.g. Wordfence, Sucuri, iThemes) or your web host has a web application firewall installed by default, they might mistakenly identify the editor’s background requests as malicious and block them.

This results in WordPress getting no data or an unexpected response (often an HTML “blocked” page), thus the JSON error.

Why this causes the error? CLICK

Security plugins and firewalls watch for patterns that resemble attacks. The block editor auto-saves and sends JSON data in the background, which could trigger strict rules. For instance, some security setups disable the REST API for non-logged-in users (not typically an issue while you’re logged in), but more aggressive rules might block certain POST requests or specific content in the request. If the REST API is blocked by such a rule, the editor’s update fails because the server never returns the expected JSON. In some cases, the response might be a 403 Forbidden or a redirect to a security challenge, which is not valid JSON.

To fix this, first, temporarily disable your security plugin. We’re doing this as a test for now. Just deactivate any security plugin you have (you should have just one tops, btw!)

Then try updating a post. If the error is gone, then that plugin was likely blocking the REST request. You may need to adjust its settings.

Many security plugins have features to “disable REST API” or “block XML-RPC,” etc. By default, they shouldn’t break logged-in REST calls, but a bug or setting could.

As your first fix, you can try disabling any REST-blocking or XML-RPC-blocking features and see what happens. Also, look for options in the plugin to whitelist the REST API or disable the feature that interferes.

If the cause of the block is more nuanced, you might be dealing with a server-level firewall – for example, mod_security on Apache servers.

Hosts often enable it to block SQL injection, XSS, etc. It can sometimes flag normal actions as false positives, too. These cases are hard to diagnose because nothing changes on your site, yet the firewall is silently blocking the response.

You might not have direct control over ModSecurity rules on shared hosting, but you can contact your host. You can also take a look into server error logs around the time the error happens and look for entries involving mod_security. Provide these details to your host and ask if they can whitelist the rule or disable mod_security for your site. Hosts are usually familiar with this WordPress issue.

6. Deal with other plugin conflicts

Beyond security plugins, any poorly-coded or conflicting plugin can potentially cause the “invalid JSON response” error. When you save a post, WordPress triggers various plugin hooks (for example, to update custom fields, execute some custom block function, etc.). A bug in one of those plugins could cause an error or output that interferes with the JSON response.

Why this causes the error? CLICK

A plugin might do something during the save request that prevents WordPress from outputting the proper JSON. For instance, an outdated plugin could generate a PHP fatal error or warning in the background; if that error text gets output, it can corrupt the JSON format. Or a plugin might try to modify the REST API response and do it incorrectly. In other cases, a plugin conflict can break the REST endpoint entirely. The result is that WordPress sends back malformed data or no data to the editor, hence the error.

The fix whenever dealing with potential plugin or theme culprits is pretty classic for all WordPress issues:

First, a small disclosure: Deactivating the plugins and themes may cause your site to break. You could lose some of your configurations. But if you have a backup in place, this won’t be a problem. So create one first!

  1. Temporarily deactivate all plugins on your site (you can do this quickly in Plugins, switch to the tab labeled Active, select all, then Bulk Actions → Deactivatesee screenshot below).
  2. After that, try editing and updating a post. If the JSON error no longer appears, then one of the plugins was definitely the cause.
  3. Narrow it down. Reactivate your plugins one by one (or in small groups), testing the editor each time, to see when the problem reoccurs. When the JSON error comes back, you’ve found a conflicting plugin.
  4. Resolve or replace. Once you know which plugin is responsible, you have a few options: (a) Check if there’s an update available for that plugin. The issue might be already taken care of by a new newer version. Update it, then test again. (b) If no update is available or the plugin still fails, consider contacting the plugin’s support or developer, as they may have a workaround. (c) If the plugin isn’t crucial, you might keep it deactivated and look for an alternative plugin that provides similar functionality without causing errors.
  5. Restore plugins. Remember to reactivate the other plugins you disabled once testing is done. Only leave the problematic one inactive (or replace it) going forward.
deactivate plugins

7. Your active theme can also conflict

In some cases, your active theme might be causing the JSON response to be invalid. Themes control the appearance, but they can also include custom PHP code that runs during REST API requests. A poorly coded theme function (usually after recent update) could trigger errors during the save process.

Why this causes the error? CLICK

If your theme outputs unexpected content, it can interfere with the REST API. For example, a theme might have a custom REST API endpoint or modification that isn’t coded properly, or simply a bug that throws a PHP notice. Even an extra blank line output (a BOM issue) before the JSON output can break the format. Essentially, any fatal error or weird output from the theme during the REST request will result in an invalid (or empty) JSON response.

The fix is very similar to the plugin fix presented above, with just slight variations:

  1. Start by switching to a default theme. Go to Appearance → Themes and activate the default WordPress theme (like Twenty Twenty-Four or Five). If you have a lot of custom design, do this at a non-peak time, as it will change your site’s appearance a lot.
  2. Immediately test the editor by editing/updating a post. If the JSON error no longer occurs under the default theme, that strongly indicates something in your original theme is the problem.
  3. This next step can be tough, but there’s only a couple of solutions here: (a) Check if there’s an update available. (b) Contact the developer of the theme and inform them about the error. If the theme you have was custom-built for you, then this approach is basically your only way out. Or: (c) switch to a different theme if all else fails.

8. Check for server configuration and hosting issues

If all the above causes have been ruled out and you still see the “not a valid JSON response” error, the root cause might lie deeper in your server configuration. Occasionally, low server resources or misconfigurations at the hosting level can interfere with the WordPress REST API.

The following is a list of probable causes in this case. I’m not going to describe detailed solutions for each one, but I will provide general guidance on how to solve the issue:

  • PHP memory limits. If your server’s PHP memory limit is too low, the REST request might be failing due to out-of-memory errors. WordPress recommends at least 128 MB; 256 MB is better for larger sites. If the server runs out of memory while processing the save, the response might never be properly completed. Checking your Site Health info (under Tools → Site Health → Info → Server) will show your PHP memory limit. If it’s below 128M, consider increasing it.
php mem limit
  • PHP errors or timeouts. Similar to the above, if there are other server-side errors (PHP fatal errors, script timeouts, database issues), those could be breaking the REST response. Enabling WP_DEBUG and then checking the debug log (or the server’s error logs) can reveal if, say, a specific PHP error coincides with the JSON error. Any fatal error or exception in those logs needs to be addressed (it could be from a plugin or something server-specific).
  • Server modules and settings. Aside from mod_rewrite and mod_security (discussed earlier), other Apache/Nginx modules rarely affect the REST API. However, if you or your host added custom rules (in .htaccess, Nginx config, or a proxy) that modify how /wp-json URLs are handled, that could be an issue. For example, ensure there’s no redirect loop or forced authentication. In some cases, if you’re protecting your site with password authentication you might get all the REST API calls from the browser blocked (since the browser can’t provide those credentials) – causing a JSON error. Removing or properly configuring such protection for the REST routes will be necessary.
  • Hosting environment changes. Consider that something at the host level might have changed without you realizing. Hosting providers sometimes update PHP versions, adjust firewall rules, or change configurations. If the issue started spontaneously, ask your host if any updates or changes occurred around that time.

Final thoughts on this error

The “Updating failed. The response is not a valid JSON response.” error can commonly appear when uploading an image or publishing/updating a piece of content using the block editor.

Actually, the error is one of the most common WordPress errors. Luckily in around 90% of the cases (at least from my experience), you can get rid of it simply by giving another try to whatever you wanted to do in the first place – meaning the error is temporary. However, in some cases, a bit more troubleshooting is required.

The real cause could be anything from a rogue plugin or theme to an SSL certificate issue. Removing the error is just a matter of figuring out the reason behind it and weeding it out of your site.

I hope with the help of this tutorial you were able to fix your site! If you have any questions about the error, let us know in the comment section below.

Yay! 🎉 You made it to the end of the article!

4 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
nicleg.com
1 year ago

For me :
esc_html_e(‘View Article’, ‘NAME_OF_ANOTHER_TEXT_DOMAIN’)
in my current theme’s functions.php file was the problem. I copied this line from old theme without changing the text domain’s name and get the error (…invalid JSON) while updating a post in the admin.
Hope it helps.

nicleg.com
1 year ago
Reply to  nicleg.com

It even seems coming from the “esc_html_e()” function. I don’t have translation files, but in that case WP should silently fails on the main text ‘View article’ not translated (WP doc : “If there is no translation, or the text domain isn’t loaded, the original text is escaped and displayed.”).
But this “esc_html_e()” is in a line like :
return “… more” . esc_html_e(‘View Article’, ‘text_domain’);
which is probably generating an -slient- error.
But I don’t understand why it doens’t display an classical php page error with the number of the line cuz I have in my wp-config.php’s file:
define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG_LOG’, true );
Anyway It’ works.

My advice :
1) I’ve changed my theme by a basic WP theme, and the error desappear,
2) I’ve tried firstly with the function.php and remove all the code and test while I was put it back little by little, so I’ve found the function/line who messed up.

Last edited 1 year ago by nicleg.com
Raj
1 year ago

Thank you so much – Forcing WordPress to create a new .htaccess file worked for me.

Ivica
1 year ago
Reply to  Raj

This is great news, I am very happy that this worked for you!

Or start the conversation in our Facebook group for WordPress professionals. Find answers, share tips, and get help from other WordPress experts. Join now (it’s free)!