Gutenberg: Troubleshooting “Updating Failed” Errors

Gutenberg: troubleshooting “Updating failed” errors

The Gutenberg editor saves posts through the REST API. When saving fails, the editor shows a generic “Updating failed” banner that gives no clue about the actual cause. Here are the five most common reasons and how to fix each one.

Problem: The block editor shows “Updating failed” or “Publishing failed” when saving a post. The spinner appears, but the request fails without a clear error message.

Solution: Open the browser’s developer tools, switch to the Network tab, save the post again and look at the failed request to /wp-json/wp/v2/posts/…. Its status code and response body tell you which of the causes below you are dealing with.

Fix 1: missing or broken .htaccess (REST API returns 404)

If you see POST /wp-json/wp/v2/posts/123 → 404, the rewrite rules don’t work and requests to /wp-json/ never reach WordPress. The default WordPress .htaccess is:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Regenerate it: go to Settings → Permalinks and click Save Changes, or run wp rewrite flush --hard. If permalinks are set to “Plain”, the REST API still works through ?rest_route=, so a 404 there points to the server configuration.

Fix 2: browser cache

Cached admin scripts from an older WordPress version can break the editor after an update. Hard-reload the page (Cmd+Shift+R on macOS, Ctrl+Shift+R on Windows and Linux) or clear the browser cache.

Fix 3: mixed content or an HTTP to HTTPS redirect

If the Network tab shows a blocked mixed-content request, fix the HTTP URLs first; see WordPress mixed content: site uses HTTPS but assets load over HTTP. The save request itself may also be redirected from HTTP to HTTPS. A redirect turns the POST into a GET, so the post is never saved.

Fix 4: a security plugin blocking the REST API

Some security plugins (Shield Security, for example) can block anonymous REST API requests. The editor’s requests are authenticated with a nonce, but a firewall rule can still catch them. Look for a 401 or 403 response with a body like:

{"code":"shield_block_anon_restapi","message":"Anonymous access to the WordPress Rest API has been restricted."}

Relax the REST API rule in the security plugin’s settings and check that saving works again.

Fix 5: a cache serving REST API responses

If a caching plugin or the server cache stores /wp-json/ responses, the editor receives a stale cached response instead of the save confirmation. Exclude /wp-json/ from the cache rules.

If nothing above helps

Isolate the problem: deactivate all plugins, switch to a default theme (Twenty Nineteen) and try saving. If saving works, re-enable plugins one at a time until the problem returns: that plugin is the culprit. A PHP error during the save also breaks the JSON response, so check wp-content/debug.log with WP_DEBUG_LOG enabled.