Introduction
You’re writing a post in the block editor, hit Save or Publish, and instead of saving, a small red notice appears: “Updating failed” or “Publishing failed.” Sometimes there’s more detail, like “The response is not a valid JSON response.” Your content is usually still safe in the editor (don’t close the tab!), but something behind the scenes is broken. Here’s what’s actually happening and how to fix it.
Why This Happens: It’s a REST API Problem
The block editor doesn’t save posts the traditional way — it sends the content to WordPress’s REST API (the same system that powers the app-like editing experience) at a URL like yoursite.com/wp-json/wp/v2/posts. When you see “Updating failed,” that request failed or returned something the editor couldn’t understand. Common causes:
- A plugin or security setting is blocking access to
/wp-json/ - Permalink rewrite rules are stale or broken, so the REST API URL doesn’t resolve
- A plugin or theme is printing a PHP warning or notice that corrupts the JSON response
- A mismatch between your WordPress Address and Site Address (or an http/https mismatch) breaks the internal request
- A firewall or security plugin is blocking the site from making requests to itself
Fix 1: Check Whether the REST API Is Reachable
Open a new browser tab and go to:
https://yoursite.com/wp-json/
You should see a page of JSON text describing your site. If instead you get a 404, a blank page, or an error, that confirms the REST API itself is blocked or broken — move to Fix 2 and Fix 4. If it loads fine, the problem is more likely a PHP warning corrupting the response (Fix 3) or a plugin conflict (Fix 4).
Fix 2: Re-save Your Permalinks
The REST API relies on the same rewrite rules as your normal URLs. A quick refresh often resolves broken routing:
- Go to Settings → Permalinks in wp-admin.
- Without changing anything, click Save Changes.
- Try publishing again.
Fix 3: Look for a PHP Warning Breaking the JSON Response
If a plugin or theme outputs so much as one stray Warning: or Notice: line before the API sends its response, the response is no longer valid JSON and the editor rejects it — this is exactly what “The response is not a valid JSON response” means. To find it:
- Add this to
wp-config.phpabove/* That's all, stop editing! */:define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false ); - Try publishing again to trigger the error.
- Open
wp-content/debug.logand look at the most recent lines — the warning will name the exact plugin or theme file responsible. - Update or deactivate that plugin, then turn
WP_DEBUGback off.
Fix 4: Rule Out a Plugin or Security Setting Blocking the API
Some security plugins offer a setting to “Disable REST API” or restrict it to logged-in users only — which can end up blocking WordPress’s own editor. Check your security plugin’s settings for anything mentioning “REST API” and temporarily disable that restriction. If you’re not sure which plugin is responsible, deactivate plugins via FTP (rename the plugins folder, then reactivate them one by one) to isolate the culprit.
Fix 5: Check for a Site URL Mismatch
Go to Settings → General and confirm WordPress Address (URL) and Site Address (URL) both use the same protocol (both https://, not one http:// and one https://) and the same domain. A mismatch can break the internal request the editor makes to save your content.
Fallback While You Debug: Use the Classic Editor
If you’re on deadline and need to publish right now, install the Classic Editor plugin as a temporary workaround — it saves posts the traditional way, without depending on the REST API, so you can keep publishing while you track down the root cause above.
Frequently Asked Questions
Will I lose the post I was writing?
Usually no — the block editor keeps your content in the browser and often auto-saves a local backup. Don’t refresh or close the tab; instead, try copying your content out (select all, copy) into a text file as a safety net before troubleshooting.
Is this the same as the “Are You Sure You Want To Do This” error?
No — that one is a nonce (security token) expiring, usually from leaving a page open too long or using the browser’s back button. This error is about the REST API request itself failing, a different mechanism entirely.
It only fails on some posts, not others — why?
That points toward a PHP warning triggered by specific content (certain blocks, plugins tied to specific post types, or custom fields) rather than a site-wide block. Fix 3’s debug log will show exactly when it fires.
Could a caching plugin cause this?
Yes — some caching or security plugins cache or filter /wp-json/ requests in ways that break the editor. Try excluding /wp-json/* from any caching rules as a test.
Conclusion
“Updating failed” and “Publishing failed” both point to the same root cause: a broken REST API request behind the block editor. Confirm /wp-json/ loads, re-save your permalinks, check the debug log for a stray PHP warning, and rule out a security plugin blocking the API. Once you find the specific plugin or setting responsible, the fix is usually a single toggle.
Don’t let a broken plugin cost you content
Nota Backup & Restore keeps automatic backups of your entire site, so testing and disabling plugins to isolate an issue never risks losing real work. Start your 14-day free trial — no credit card required.
