🎉 New: Top 75 PHP Interview Questions for 2026 — Free for all learners

How to fix The error “Updating failed. The response is not a valid JSON response.” in WordPress

P
php Guru
· · 2 min read ·

📌 Key Takeaways

  • How to fix The error “Updating failed. The response is not a valid JSON response.” in WordPress
  • Refresh Permalinks (Most Common Fix)
  • Check Site URL (HTTP vs HTTPS)
  • Disable Security / Cache Plugins
  • Check REST API
  • Fix .htaccess

The error “Updating failed. The response is not a valid JSON response.” in WordPress usually means the editor cannot communicate correctly with your server. This is very common and usually caused by permalinks, plugins, security rules, or server configuration.

Follow these fixes in order (most cases solved in Step 1 or 2).


  1. Go to Dashboard → Settings → Permalinks
  2. Click Save Changes (without changing anything)

This rebuilds WordPress rewrite rules and fixes many JSON errors.


Check Site URL (HTTP vs HTTPS)

Sometimes the editor sends requests to a different URL.

Go to:

Settings → General

Make sure both are the same:

WordPress Address (URL)
Site Address (URL)

Example (correct):

https://moralstory.in
https://moralstory.in

NOT:

http://moralstory.in
https://moralstory.in

Disable Security / Cache Plugins

Temporarily disable plugins like:

  • Wordfence
  • LiteSpeed Cache
  • WP Rocket
  • All In One Security

Then try updating the post again.


Check REST API

Open this in browser:

https://moralstory.in/wp-json/

If it shows JSON text → REST API is working.

If it shows 403 / error / blank page → hosting or security blocking it.


Fix .htaccess

Open .htaccess in root and replace with:

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

Increase PHP Limits

Add in wp-config.php

define('WP_MEMORY_LIMIT', '256M');

Cloudflare / Firewall Issue

If you use:

  • Cloudflare
  • hosting firewall

Disable Bot protection / ModSecurity temporarily.


Console Error Check

Press:

F12 → Console

If you see:

403
500
rest_cookie_invalid_nonce

tell me the error.


Quickest Fix (Usually Works)

Do these 3 steps first:

  1. Settings → Permalinks → Save
  2. Clear cache plugin
  3. Check https vs http
P
php Guru
PHP Developer & Technical Writer — phponline.in A seasoned PHP developer with 8+ years of experience in Laravel, MySQL, and REST APIs. Writes practical tutorials and career guides to help developers grow their skills and income. All salary data is researched from real job postings and developer surveys.
← Previous Post
How to Connect PHP with MySQL Using PDO (Step-by-Step Guide)
Next Post →
We are currently paying for PHP Extended Support because the site is running an outdated PHP version. how to fix it