WordPress "Updating failed. The response is not a valid JSON response."
You press Update or Publish in the block editor and get this red bar. The editor asked your site's REST API to save the post, and something other than WordPress answered. The post is not saved.
What to do, in order
- Re-save permalinks. Settings, Permalinks, press Save without changing anything. This rewrites the .htaccess rules the REST API needs. It fixes most cases.
- Check the address settings. Settings, General. "WordPress Address" and "Site Address" must both start with https:// if your site uses SSL, and must match each other. A mismatch sends the save request to the wrong place.
- Test the API directly. Open
yoursite.com/wp-json/ in a browser. You should see a wall of text starting with {"name":. A 404 means rewrites are broken (step 1, or ask your host to enable mod_rewrite). A 403 means a security plugin or firewall is blocking it.
- Security plugin or firewall. Wordfence, iThemes, Cloudflare WAF and host firewalls (ModSecurity) often block the save request, especially if your post contains code or certain words. Turn the plugin off for a minute and try again. If it saves, whitelist
/wp-json/.
- Plugin conflict. Deactivate all plugins, try to save, then turn them back on one at a time.
- Mixed content. If the site loads on http but WordPress is set to https (or the other way round), the browser blocks the request. Force one version with a redirect.
If it still fails, send me the address and I will tell you what is answering instead of WordPress.
Want the rest of your site checked after it is back? Run a free 40-point check at tinkeraudit.com.