Home › Blog › WordPress “The Response Is Not a Valid JSON Response”: Why It Happens and How to Fix It

WordPress “The Response Is Not a Valid JSON Response”: Why It Happens and How to Fix It

By Auroxa Tech · Updated · 9 min read

WordPress “Not a Valid JSON Response”? Fix It

“Updating failed. The response is not a valid JSON response” means the block editor asked the WordPress REST API to save your post and got something other than JSON: an error page, a login page, a firewall block or PHP warnings. Read the failed request in the browser’s Network tab, test /wp-json/, re-save permalinks, then check addresses, SSL and plugins.

Why WordPress says the response is not valid JSON

The block editor doesn’t save a page the way the old editor did. WordPress’s REST API handbook describes the REST API as the way WordPress sends and receives data as JSON, and calls it the foundation of the block editor. When you click Update or Publish, the editor sends a request to an address under /wp-json/ and waits for a JSON reply. If anything else comes back, such as an HTML error page, a login screen, a firewall’s “Forbidden” page or a PHP warning printed before the JSON, the editor can’t read it and shows “Updating failed” or “Publishing failed. The response is not a valid JSON response.” The same message appears when uploading images or saving settings in plugins that use the REST API.

That is why the message is so common and so unhelpful. It tells you the reply was wrong, not why. On the WordPress.org support forums the same words lead to very different causes. In one 2024 thread, an Nginx cache plugin update broke saving until its author shipped a fixed version. In a December 2025 thread about a security plugin’s settings, support asked about blocked request methods, 403 errors and firewall rules, and the cause turned out to be a conflict with a different plugin (both community reports). A July 2026 thread on WordPress 7.0.1 traced a failed upload to a request that came back with the wp-login.php page instead of JSON (community report).

Even a core bug report about the message, ticket #48268, was closed as “worksforme” in January 2026, because the error depends on the site, not on WordPress itself. So the job is to look at the one request that failed and let it tell you which layer answered: WordPress, a plugin, the web server or a firewall in front of it.

What you seeLikely causeFix (step n)
Failed request shows 404Rewrite rules missing, so /wp-json/ isn’t routedRe-save permalinks, check .htaccess or Nginx (steps 2 and 3)
Failed request shows 403 or a “Forbidden” pageSecurity plugin, host firewall or CDN blocking the requestFind the rule and allow the editor’s requests (step 6)
Response starts with “Warning” or “Notice”PHP messages printed into the replyLog errors to a file instead of the screen (step 5)
Response is the login page or a redirectSite address, http/https or a plugin restricting accessFix the site addresses and SSL (step 4)
500 errorA PHP fatal error in a plugin or themeRead debug.log, then isolate plugins (steps 5 and 7)
Error started right after an updateThat plugin or theme changed how it handles requestsRoll it back or update it (step 7)

Before you change anything

  • Copy your text somewhere safe. If the editor can’t save, your changes exist only in the browser tab. Select the content, copy it into a text file, and you can stop worrying about losing it.
  • Take a backup. Files and database, from your host’s panel or your backup plugin. Several steps below change settings or plugins.
  • Note what changed recently. A plugin update, a new security or caching plugin, a move to HTTPS, a new domain or a CDN. The error usually starts the day one of these happens.
  • Don’t turn off the REST API. WordPress’s REST API FAQ says disabling it “will break WordPress Admin functionality.” If a plugin or code snippet disabled it, that alone explains the error.
  • Try one save in a private window. If it works there, a browser extension or an old login cookie is involved, and the server is fine.

How to fix it, step by step

Step 1: Read the failed request in the Network tab

This is the step most guides skip, and it saves the most time. Open the page in the editor, open your browser’s developer tools (F12, or right-click and Inspect), choose the Network tab and click Update again. Look for the request in red, usually to an address containing /wp-json/wp/v2/posts or /wp-json/wp/v2/pages. Note its status code, then open its Response tab. A 2022 support thread shows exactly this: the console listed 400 and 418 errors on the posts and autosaves requests, which pointed the host to a conflict (community report). The status code and the first lines of the response decide which of the next steps you need, so you can skip the rest.

Step 2: Test the REST API address directly

Visit yoursite.com/wp-json/ in the browser. A working site returns a long block of JSON describing the site. The REST API discovery page explains the second address to try: without pretty permalinks, /wp-json/ isn’t handled and the API lives at yoursite.com/?rest_route=/. If the second address returns JSON and the first returns a 404 page, the API works and the server isn’t routing /wp-json/ to WordPress. That is a rewrite problem, and step 3 fixes it. If both return an error page, the request is being stopped earlier, which points to steps 5 and 6.

Step 3: Re-save permalinks and check the rewrite rules

Go to Settings, then Permalinks, and click Save Changes without changing anything. The Permalinks screen documentation says that if .htaccess is writable WordPress updates it and shows “Permalink structure updated,” and if not, it shows the rules for you to copy into .htaccess by hand. A missing or broken .htaccess after a migration or a security plugin edit is a common reason /wp-json/ returns 404. On Nginx there is no .htaccess; the REST API FAQ says the server’s try_files line should pass query strings with $is_args, which is something your host or developer changes in the server configuration.

Step 4: Check the site addresses and HTTPS

In Settings, then General, compare WordPress Address (URL) and Site Address (URL). The General Settings documentation explains that the Site Address is what visitors type and normally matches the WordPress Address unless WordPress lives in its own folder. Both should use the same protocol and the same www or non-www form as the address in your browser bar. A mismatch, for example http in the settings while the site loads over https, usually makes the editor’s request get redirected, and a redirected save often comes back as a page instead of JSON. If the fields are greyed out, WP_HOME or WP_SITEURL is set in wp-config.php, and that is where to correct them.

Step 5: Turn on the debug log, not the debug display

If the response in step 1 starts with “Warning,” “Notice” or “Deprecated,” PHP is printing messages into the reply, and those few lines of text are enough to make it invalid JSON. WordPress’s debugging guide shows the safe setup in wp-config.php: WP_DEBUG set to true, WP_DEBUG_LOG set to true, and WP_DEBUG_DISPLAY set to false. Messages then go to wp-content/debug.log instead of the page. The guide notes that WP_DEBUG_DISPLAY controls whether messages appear inside the HTML. Save again, then read the newest lines of debug.log; a fatal error there (the 500 case) names the plugin or theme file. Site Health under Tools is worth a look too: it flags errors displayed to visitors, failed loopback requests and an active PHP session that interferes with REST API requests.

Step 6: Look for a firewall or security rule

A 403, a “Forbidden” page or a challenge page in the response means something in front of WordPress refused the save. Check, in order: a security plugin’s firewall or “disable REST API” option, your host’s web application firewall (often ModSecurity or a similar rule set on shared hosting), and a CDN such as Cloudflare. Their logs usually show the blocked request with a rule number. Ask the host to allow that rule for the editor’s requests rather than switching the firewall off. The December 2025 thread above is a good model: support asked whether the host blocked some request methods, such as PUT, or returned 403s on the plugin’s REST address before anyone touched code (community report).

Step 7: Isolate the plugin or theme

If nothing above explains it, deactivate plugins one at a time and try saving after each, starting with security, caching, optimization and any plugin updated in the last few days. Then switch briefly to a default theme. The Health Check and Troubleshooting plugin can do this only for your own login while visitors still see the normal site. When saving works, the last plugin you turned off is the cause: look for an update, roll back to the previous version, or report it to the author with the response text from step 1. In the 2024 cache plugin thread, that report is what got the bug fixed in a later release (community report).

Step 8: Save, then watch the next few edits

Once one save works, edit and save two or three other pages, upload one image and check that scheduled posts publish. Turn WP_DEBUG back off when you are done, or at least keep WP_DEBUG_DISPLAY false on a live site. Write down what fixed it, because the same plugin or rule tends to come back with the next update.

What these steps can’t do

  • They can’t change a host firewall you don’t control. If the block comes from your host’s rules, only the host can adjust them.
  • They can’t fix a plugin’s bug. You can find the plugin and roll it back, but the real fix is the author’s update.
  • Switching to the Classic Editor hides the symptom but doesn’t fix it. Other features that use the REST API, including many plugins and the mobile apps, will still fail.
  • They don’t recover unsaved text. Whatever you didn’t copy before the browser tab closed is gone; WordPress autosaves only reach the server when the request works.

If the site shows “There has been a critical error” instead, the WordPress critical error guide covers that case, and WordPress stuck in maintenance mode covers an update that stopped halfway.

Our website fixes service finds and repairs errors like this on WordPress sites, including host firewall and plugin conflicts. If your editor won’t save, send us the status code and the first lines of the failed response, and we’ll tell you what we see.

Frequently asked questions

What does “The response is not a valid JSON response” mean in WordPress?

The block editor saves through the WordPress REST API and expects a JSON reply. The message means the reply was something else, such as an error page, a login page, a firewall block or PHP warnings printed before the JSON. The failed request in the browser’s Network tab shows which.

How do I fix “Updating failed” in WordPress?

Read the failed request’s status code in the Network tab, test yoursite.com/wp-json/, re-save permalinks, check that the WordPress and Site Address match the address you use, log PHP errors to a file instead of the screen, and deactivate plugins one at a time until saving works.

Why does the error only happen on some pages or images?

Usually because a firewall rule matches something in that content, such as code snippets or certain words. The status code of that one request, often 403, points to the rule.

Should I install the Classic Editor to stop the error?

Only as a short workaround. It avoids the block editor’s request but leaves the REST API broken, and other features and plugins that rely on it will keep failing. Fix the cause, then remove the workaround.

Can I disable the WordPress REST API for security?

No. WordPress’s own REST API FAQ says disabling it breaks WordPress admin functionality. If you want to limit it, block access for visitors who aren’t logged in instead, which keeps the editor working.

Sources

Want help with this?

Read about Website & app fixes, or book a session to talk it through.