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

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).


Refresh Permalinks (Most Common Fix)

  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
Related Article
50+ PHP Interview Questions and Answers 2023

1. Differentiate between static and dynamic websites. Static Website The content cannot be modified after the script is executed The Read more

All We Need to Know About PHP Ecommerce Development

  Many e-commerce sites let you search for products, show them off, and sell them online. The flood of money Read more

PHP Custom Web Development: How It Can Be Used, What Its Pros and Cons Are,

PHP is a scripting language that runs on the server. It uses server resources to process outputs. It is a Read more

PHP Tutorial

PHP Tutorial – Complete Guide for Beginners to Advanced Welcome to the most comprehensive PHP tutorial available online at PHPOnline.in Read more

Introduction of PHP

Introduction to PHP – Learn PHP from Scratch with Practical Examples Welcome to your complete beginner's guide to PHP. Whether Read more

Syntax Overview of PHP

Syntax Overview of PHP (2025 Edition) Welcome to phponline.in, your one-stop platform for mastering PHP. This comprehensive, SEO-rich tutorial on Read more

Environment Setup in PHP

Setting Up PHP Environment (Beginner’s Guide) If you’re planning to learn PHP or start developing websites using PHP, the first Read more

Variable Types in PHP

PHP Variable Types: Complete Beginner's Guide to PHP Data Types Welcome to phponline.in, your trusted source for beginner-to-advanced level PHP Read more

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    Prove your humanity: 2   +   5   =