WordPress Valid JSON Response Error: Fixes
This error means WordPress's editor called the REST API and got back something that wasn't JSON — usually HTML from an error page or redirect. Fix it in this order: resave permalinks, check the REST API is reachable, confirm the site URL/HTTPS, then deactivate plugins.
- The editor talks to
/wp-json/; if that returns an error page or HTML, you get "not valid JSON". - Broken permalinks are the #1 cause — resaving them rewrites the rules and often fixes it.
- Mixed HTTP/HTTPS or a wrong Site Address makes the REST call resolve to the wrong place.
- Security plugins and firewalls sometimes block
/wp-json/— a frequent hidden cause. - Test the endpoint directly by visiting
yoursite.com/wp-json/in a browser.
This error often occurs for webmasters when updating or publishing posts in WordPress. You may see it in several variations:
There are several ways to resolve this issue.
Disable the Gutenberg block editor

After updating WordPress to version 5.0, the Gutenberg editor was enabled by default for everyone, which brought plenty of problems and questions. That’s why I disable Gutenberg on all WordPress sites. To disable it, you can use:
- Paid plugin Clearfy — will fix the publishing error and also eliminate many other common WordPress issues
- Free plugin Classic Editor After installation and activation, the Gutenberg editor will stop working and you will be able to publish posts again.

Other ways to resolve the problem
If the publishing error persists after disabling Gutenberg, here are alternative solutions.
-
Click Save Changes.
-
Check whether the issue is resolved.
No SSL certificate It is recommended to use free Let’s Encrypt SSL certificates.
Fix mixed content
-
In settings, make sure your site URLs start with https.
-
Install and activate the Really Simple SSL plugin.
-
In Settings -> SSL, enable Mixed content fixer, Enable WordPress 301 Redirection to SSL, Enable 301.htaccess redirect.
Check REST API and wp-json activation
Deactivating the REST API is a common cause of errors when updating pages and posts.
To check, go to the theme editor and open the functions.php file. Carefully review the code. If REST API and wp-json have been disabled, you will find lines like these:
// Disable REST API
add_filter('rest_enabled', '__return_false');
// Remove REST API filters
remove_action( 'xmlrpc_rsd_apis', 'rest_output_rsd');
remove_action( 'wp_head', 'rest_output_link_wp_head', 10, 0);
remove_action( 'template_redirect', 'rest_output_link_header', 11, 0);
remove_action( 'auth_cookie_malformed', 'rest_cookie_collect_status');
remove_action( 'auth_cookie_expired', 'rest_cookie_collect_status');
remove_action( 'auth_cookie_bad_username', 'rest_cookie_collect_status');
remove_action( 'auth_cookie_bad_hash', 'rest_cookie_collect_status');
remove_action( 'auth_cookie_valid', 'rest_cookie_collect_status');
remove_filter( 'rest_authentication_errors', 'rest_cookie_check_errors', 100);
// Cancel REST API events
remove_action( 'init', 'rest_api_init');
remove_action( 'rest_api_init', 'rest_api_default_filters', 10, 1);
remove_action( 'parse_request', 'rest_api_loaded');
// Disable REST API–related embeds
remove_action( 'rest_api_init', 'wp_oembed_register_route');
remove_filter( 'rest_pre_serve_request', '_oembed_rest_pre_serve_request', 10, 4);
remove_action( 'wp_head', 'wp_oembed_add_discovery_links');
remove_action( 'wp_head', 'wp_oembed_add_host_js');
If you find similar code, remove it. Then go to **Settings **-> Permalinks and click Save Changes.