If you are editing a post or page in WordPress and suddenly see an error like:
“Updating failed. The response is not a valid JSON response.”
you are not alone.
This is one of the most frustrating WordPress block editor issues because it appears without warning and prevents you from saving your content. The editor may work fine for days, and then suddenly fail after a plugin update, server change, SSL setup, or hosting migration.
If your WordPress site is down, hacked, broken after an update, or showing critical errors, you should not wait. Get instant, professional help with this Emergency WordPress Support service that fixes site crashes, white screens, database errors, hacked websites, and WooCommerce failures fast and safely.
The good news is this problem is 100% fixable once you understand what is causing it.
In this in-depth guide, you will learn exactly why the WordPress block editor shows a JSON error on save, how the block editor communicates with your site, and step-by-step solutions that work on shared hosting, VPS, and managed WordPress servers. If your site has already been hacked or you want to prevent future attacks, choosing the right protection matters. This comparison of the best WordPress security plugins helps you secure your site against malware, brute-force attacks, and unauthorized access.
What Does “Block Editor Showing JSON Error on Save” Mean?
The WordPress block editor (Gutenberg) relies heavily on the REST API to save and update content.
When you click Save or Update, WordPress sends a request to the REST API endpoint:
If the editor expects a valid JSON response but receives HTML, PHP warnings, server errors, or blocked requests, it throws this message:
“The response is not a valid JSON response.”
So this error does not mean your content is broken. It means something interrupted communication between the editor and your server.
Common Symptoms of the JSON Error
You may notice one or more of the following:
-
Block editor fails to save or update posts
-
Error appears only for certain post types
-
Error appears only for logged-in users
-
Classic editor works but block editor does not
-
REST API endpoints return 403, 401, or 500 errors
-
Media uploads fail in the editor
Main Causes of Block Editor JSON Error
Before fixing it, you need to understand what typically causes this issue.
1. REST API Blocked or Failing
The block editor cannot function without REST API access.
2. Incorrect Permalink Settings
Broken rewrite rules prevent REST endpoints from resolving.
3. SSL / HTTPS Misconfiguration
Mixed content or incorrect site URLs break editor requests.
4. Plugin or Theme Conflicts
Security, caching, or optimization plugins often block REST requests.
5. Hosting Firewall or ModSecurity Rules
Servers may block PUT or POST requests required by the editor.
6. PHP Errors or Warnings
Any unexpected output breaks JSON responses.
7. Incorrect Site URL or Home URL
Mismatched URLs confuse the editor during save requests.
Step-by-Step: How to Fix Block Editor Showing JSON Error on Save
Follow these solutions in order. In most cases, the issue is resolved before reaching the last step.
1. Check WordPress Site URL and Home URL
Incorrect URLs are one of the most common causes. If your WordPress site is stuck in an HTTP to HTTPS redirect loop, showing ERR_TOO_MANY_REDIRECTS, or loading mixed content after enabling SSL, the issue usually lies in incorrect URL settings, .htaccess rules, or server-level misconfiguration. This complete guide explains how to fix WordPress HTTP to HTTPS redirect issues permanently without breaking SEO or site accessibility.
Go to:
Dashboard → Settings → General
Make sure both values are identical:
Example:
If your site uses HTTPS, both must use HTTPS.
If you cannot access wp-admin, add this to wp-config.php:
Save the file and try editing again.
2. Re-Save Permalinks (Very Important)
Broken rewrite rules frequently break REST API routes.
Go to:
Dashboard → Settings → Permalinks
-
Do not change anything
-
Click Save Changes
This regenerates .htaccess rewrite rules and fixes REST endpoints in many cases.
3. Test the REST API Manually
Go to this URL in your browser:
You should see a JSON output, not a blank page or error.
If you see:
-
403 Forbidden
-
401 Unauthorized
-
500 Internal Server Error
Then the REST API is blocked or failing.
4. Enable WordPress Debug Mode
Sometimes PHP warnings break JSON output. When WordPress errors are unclear or keep appearing without explanation, enabling debugging is the fastest way to identify the root cause. This guide on how to enable WordPress debug mode to find errors shows exactly how to log and trace issues safely.
Add this to wp-config.php:
Now reproduce the error and check:
If you see warnings or notices, fix them or disable the plugin/theme causing them.
5. Disable All Plugins (Conflict Test)
Plugins are responsible for most JSON errors. If a plugin has locked you out of the admin area or caused a fatal error, disabling it manually is often the fastest fix. This guide on how to disable WordPress plugins without admin access explains safe methods using FTP and the database.
Temporarily disable all plugins by renaming the plugins folder:
Now try saving a post.
If the error disappears, rename the folder back and activate plugins one by one until the error returns.
Common problem plugins include:
-
Security plugins
-
Caching plugins
-
REST API restriction plugins
-
Firewall or login protection plugins
6. Check Security and Firewall Plugins
Security plugins often block REST requests.
Look for settings related to:
-
REST API protection
-
XML-RPC blocking
-
JSON endpoint restrictions
-
Brute force protection
Whitelist these REST routes if available:
If unsure, temporarily disable the security plugin and test again.
7. Switch to a Default Theme
Themes can also break editor responses.
Go to:
Appearance → Themes
Activate Twenty Twenty-Four or another default theme.
If the error disappears, your theme has:
-
PHP warnings
-
Invalid output
-
REST API conflicts
Check functions.php for echo, print, or var_dump statements. If your WordPress theme breaks after an update or customization, you don’t need to panic. This guide on how to restore a broken WordPress theme without losing data walks you through safe methods to recover your site while keeping your content intact.
8. Fix SSL and Mixed Content Issues
If your site recently moved to HTTPS, mixed content can break editor requests. Fix Too Many Redirects Error in WordPress – Complete troubleshooting for redirect loops caused by SSL misconfiguration, caching plugins, permalink issues, and server rewrite rules.
Open browser DevTools → Console and check for errors like:
Force HTTPS by adding to wp-config.php:
Also update URLs in the database using a safe search-replace method.
9. Check .htaccess File
Corrupt rewrite rules can block REST API calls.
Default WordPress .htaccess:
Replace your file with the above and save permalinks again.
10. Disable ModSecurity (Hosting Issue)
Many shared hosts block REST requests using ModSecurity.
Symptoms:
-
REST API returns 403
-
Error only on live server, not local
Contact your hosting support and ask them to:
-
Disable ModSecurity for your domain
-
Whitelist WordPress REST API endpoints
This single step fixes the issue on many shared hosting plans.
11. Increase PHP Memory Limit
Low memory can interrupt save requests. If your WordPress site shows the Allowed memory size exhausted error, crashes after plugin activation, or fails to load admin pages, the issue is usually caused by low PHP memory limits, heavy plugins, or poorly optimized themes. This complete guide explains how to fix the allowed memory size exhausted error in WordPress permanently using safe, proven methods that work on shared hosting and VPS servers.
Add to wp-config.php:
12. Fix CORS and Authorization Headers
Some servers strip authorization headers required by REST API.
Add this to .htaccess:
Or in NGINX:
13. Update WordPress, PHP, and Server Stack
Outdated environments cause compatibility issues.
Recommended:
-
WordPress: Latest stable
-
PHP: 8.0 or 8.1
-
MySQL: 5.7+ or MariaDB 10.4+
Avoid PHP 8.3 on older plugins.
14. Fix JSON Error After Migration
If the error appeared after migration:
-
URLs were not updated correctly
-
SSL was partially configured
-
Database still contains old domain
Run a full search-replace for:
Why This Error Happens More in the Block Editor
The classic editor submits forms traditionally.
The block editor:
-
Uses JavaScript
-
Uses REST API
-
Expects strict JSON responses
Any extra output breaks it.
That is why even a single PHP notice can cause failure.
How to Prevent JSON Errors in the Future
-
Avoid poorly coded plugins
-
Always test updates on staging
-
Keep debug mode off on production
-
Do not block REST API unless required
-
Use reputable hosting with WordPress support
Frequently Asked Questions
Why does WordPress say the response is not a valid JSON response?
Because the block editor expected JSON from the REST API but received an error, HTML, or blocked response instead.
Can this error cause data loss?
No. Your content is usually safe and stored as a draft.
Does this error affect WooCommerce products?
Yes. WooCommerce products use the same block editor system.
Will switching to Classic Editor fix it?
Temporarily, yes. But it does not solve the root cause.
Is this a hosting issue or WordPress issue?
It can be either. Hosting firewalls and plugin conflicts are the most common causes.
Final Thoughts
The Block Editor Showing JSON Error on Save is not a bug in WordPress itself. It is a signal that something on your site or server is interfering with REST API communication. By following the fixes in this guide, you can confidently identify the root cause and permanently resolve the issue. If you manage multiple WordPress sites or client projects, bookmarking this guide will save you hours of frustration.