Skip to main content

How to Fix "The response is not a valid JSON response" Error in WordPress

You may encounter the following error message while trying to update a post or page in WordPress:

"The response is not a valid JSON response."

This issue often occurs due to security rules triggered on the server, especially when using mod_security on Linux-based shared hosting environments.

What Causes This Error?

On our Linux shared hosting service, mod_security is enabled by default for all cPanel accounts. Mod_security is a web application firewall (WAF) that helps protect your site from common exploits. However, in some cases, it may block legitimate WordPress actions—such as saving or updating posts—mistaking them for suspicious activity.

How to Fix It

To resolve this issue, you can temporarily disable mod_security for your domain:

  1. Log in to your cPanel account.
  2. Look for the ModSecurity option under the "Security" section.
  3. Select your domain from the list.
  4. Click Disable to turn off mod_security for that domain.

Once you've made the necessary updates in WordPress, we recommend re-enabling mod_security to maintain your website's security.

Recommendation

We suggest keeping mod_security disabled only while troubleshooting or making changes that trigger the error. Afterward, re-enable it to ensure continued protection against malicious activity.