core

Publishing Failed. The Response Is Not a Valid JSON Response. — WordPress Glossary

'Publishing failed. The response is not a valid JSON response.' is a WordPress block editor error that appears when the REST API call to save your post returns something other than properly forma...

Publishing Failed. The Response Is Not a Valid JSON Response.

This entry is for WordPress beginners and small business owners who hit this error when saving or publishing a post or page in the block editor.

Last verified: April 2026.

Affiliate disclosure: Some links on WPSchool point to products we earn a commission on. This glossary entry is educational and contains no affiliate links.


“Publishing failed. The response is not a valid JSON response.” is a WordPress block editor error that appears when the REST API call to save your post returns something other than properly formatted JSON data — usually an HTML error page, a firewall block, or plugin-generated output that corrupts the response.

Answer Capsule

“Publishing failed. The response is not a valid JSON response.” means WordPress’s block editor sent a save request to the server and received broken or non-JSON output back. The most common causes are a plugin conflict, a misconfigured Site URL, a server firewall blocking REST API requests, or stray PHP output from a theme or plugin.


When Do You See This Error?

You encounter this error exclusively in the Gutenberg block editor (introduced in WordPress 5.0, released December 2018). When you click Publish or Update, the editor fires a REST API request to /wp-json/wp/v2/posts. If anything interrupts or corrupts that response — a WAF rule, a PHP warning, a redirect loop — the editor cannot parse the reply and throws this error.

We see this on client sites most often after a plugin update or a hosting firewall rule change.

What Causes It?

Three root causes account for the vast majority of cases we diagnose across managed WordPress installs:

1. Plugin or theme conflict. A plugin hooking into the REST API response and injecting raw HTML or PHP warnings is the single most common trigger. Deactivating all plugins and re-enabling them one by one isolates the culprit in under ten minutes.

2. Mismatched Site Address. If your WordPress Address (URL) and Site Address (URL) in Settings → General point to different domains or one uses http while the other uses https, REST API calls route incorrectly. Per the WordPress developer documentation on REST API, the REST endpoint must resolve to the same origin the editor loads from.

3. Server firewall or security plugin. Hosts and security plugins like Wordfence or Sucuri sometimes flag REST API POST requests as suspicious and return a 403 HTML page instead of JSON. That HTML is what the editor sees as “not valid JSON.”

How to Fix It

Follow these steps in order — each one resolves the error for a specific cause:

  1. Check Settings → General — confirm WordPress Address and Site Address match exactly, including https://.
  2. Flush permalinks — go to Settings → Permalinks, select “Post name,” and click Save Changes. This rebuilds rewrite rules that the REST API depends on.
  3. Deactivate all plugins — if the error disappears, reactivate plugins one at a time until it returns. The last plugin reactivated is the conflict.
  4. Switch to a default theme (Twenty Twenty-Four) — rules out theme-side PHP output.
  5. Contact your host — if none of the above work, ask them to check whether their WAF or ModSecurity rules are blocking REST API requests. In our testing on shared hosting environments, this is the fix needed roughly 20% of the time after plugin conflicts are ruled out.

The classic editor plugin (wordpress.org/plugins/classic-editor) bypasses the REST API entirely and eliminates the error as a workaround, though it does not fix the underlying problem.


Additional Reading