• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

ReviewsLion

Reviews of online services and software

  • Hosting
  • WordPress Themes
  • SEO Tools
  • Domains
  • Other Topics
    • WordPress Plugins
    • Server Tools
    • Developer Tools
    • Online Businesses
    • VPN
    • Content Delivery Networks

How to Fix the “Not a Valid JSON Response” Error in WordPress

Encountering the “Not a Valid JSON Response” error in WordPress can be a frustrating experience, especially when all you’re trying to do is update a page or post. This error typically appears when using the Gutenberg block editor and usually points to issues related to communication with the WordPress REST API. Fortunately, there are several ways to diagnose and resolve this issue efficiently.

Table of contents:
  • What Causes the “Not a Valid JSON Response” Error?
  • How to Fix the “Not a Valid JSON Response” Error
    • 1. Check Site and WordPress URLs
    • 2. Update Permalink Structure
    • 3. Check for Mixed Content and SSL Issues
    • 4. Inspect and Disable Conflicting Plugins
    • 5. Use Default Theme
    • 6. Check .htaccess File
    • 7. Disable Gutenberg or Use Classic Editor
    • 8. Test REST API Health Under Site Health Tool
    • 9. Adjust Security Plugins or ModSecurity
    • 10. Enable Debugging Mode
    • 11. Configure HTTP Authorization through .htaccess
  • Preventing the JSON Response Error in the Future
  • FAQ
    • What triggers the ‘Not a Valid JSON Response’ error in WordPress?
    • Can I ignore the JSON error if my content seems updated?
    • Should I disable Gutenberg permanently if I see this error?
    • Will switching hosting providers help fix this?
    • Is it safe to edit the .htaccess file directly?

What Causes the “Not a Valid JSON Response” Error?

This error usually means WordPress failed to establish a proper connection with the server while saving content or sending data. The REST API is vital for managing dynamic admin operations in WordPress, especially with the Gutenberg editor. When this API call fails to return a valid JSON-formatted response, WordPress throws the error message.

Several factors can trigger this problem. These include:

  • Permalink misconfigurations
  • SSL settings mismatch or mixed content issues
  • Conflicting plugins or themes
  • ModSecurity or firewall restrictions
  • Incorrect site URL or WordPress Address settings
  • Server misconfiguration or temporary outages

How to Fix the “Not a Valid JSON Response” Error

Below are step-by-step methods to help fix the issue. Some may require administrative backend access to WordPress and basic familiarity with your hosting environment.

1. Check Site and WordPress URLs

Navigate to Settings > General in your WordPress dashboard. Ensure both the WordPress Address (URL) and Site Address (URL) are consistent and use https:// if you have an SSL certificate installed. Mismatched or incorrect URLs can block REST API responses.

[h3-img]wordpress settings url site address ssl[/ai-img]

2. Update Permalink Structure

Go to Settings > Permalinks, then hit Save Changes without making any modifications. This action rebuilds your .htaccess file and can fix REST API routing issues resulting in invalid JSON responses.

3. Check for Mixed Content and SSL Issues

If you recently migrated to HTTPS, check for mixed content (loading secure and non-secure elements). Use browser developer tools to monitor the console log for mixed content warnings. You can also install plugins like Really Simple SSL to streamline your HTTPS configuration.

4. Inspect and Disable Conflicting Plugins

Temporarily deactivate all active plugins. Then, try to update a post or page. If the issue disappears, re-enable plugins one by one until the error reappears. This process helps identify the conflicting plugin causing the problem.

5. Use Default Theme

Sometimes, theme-related scripts or custom functions can interfere with the REST API. Switch to a default WordPress theme like Twenty Twenty-Four and check if the error persists. If switching themes resolves the issue, your original theme may need debugging.

6. Check .htaccess File

Corrupted or customized .htaccess files can sometimes interfere with URL rewriting. You can rename the current file and let WordPress rebuild it by saving the permalinks again. Ensure it contains the default WordPress rules:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

7. Disable Gutenberg or Use Classic Editor

If the problem continues, you can temporarily disable the Gutenberg editor. Install the Classic Editor plugin. While this doesn’t fix the REST API issue itself, it provides an immediate workaround for publishing content without interruption.

8. Test REST API Health Under Site Health Tool

The Site Health tool within Tools > Site Health highlights errors with the REST API. If WordPress flags errors like unreachable endpoints or authentication failures, it can clue you in about underlying server or security issues.

9. Adjust Security Plugins or ModSecurity

Security plugins like Wordfence and server-level firewalls like ModSecurity may block REST API calls if they detect them as suspicious activity. Check your security plugin’s logs and temporarily whitelist or disable rules that could be interfering.

10. Enable Debugging Mode

Edit your wp-config.php file by enabling debugging features which help identify backend problems during REST calls:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

This setup generates a debug log found in /wp-content/debug.log, giving clues about PHP or plugin errors.

11. Configure HTTP Authorization through .htaccess

Some servers require explicitly enabling HTTP authorization for REST API to function as expected. Add the following snippet to your .htaccess file within the root directory:

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

This ensures that the server passes HTTP headers properly to WordPress for authenticated requests.

Preventing the JSON Response Error in the Future

  • Regularly update plugins, themes, and WordPress core to prevent compatibility issues.
  • Backup your site and database before making major changes.
  • Use HTTPS throughout your site and configure it properly.
  • Test new plugins in a staging environment first to catch potential issues early.
  • Monitor REST API responses using browser tools or API monitoring plugins.

Resolving the “Not a Valid JSON Response” error requires a systematic approach, but once root causes are determined, fixes are usually straightforward. Making regular backups and conducting health checks will minimize the risk of this error recurring in the future.

FAQ

What triggers the ‘Not a Valid JSON Response’ error in WordPress?

This error is typically caused by communication issues between the WordPress editor and the server via the REST API. Triggers include permalink issues, SSL misconfiguration, plugin conflicts, or server restrictions.

Can I ignore the JSON error if my content seems updated?

Not recommended. Even if the content appears to be saved, the error suggests incomplete communication, which could lead to unsaved changes or failed autosaves in the future.

Should I disable Gutenberg permanently if I see this error?

Temporarily switching to the Classic Editor can be a workaround, but it’s better to resolve the root REST API issue and return to Gutenberg, as it offers richer editing features.

Will switching hosting providers help fix this?

If the issue stems from ModSecurity or REST API blocking on server level, yes. Reliable hosts optimized for WordPress handle these configurations properly out of the box.

Is it safe to edit the .htaccess file directly?

Yes, but cautiously. Always back up the existing file before making changes. Use a code editor, not a word processor, and test changes in a staging environment if available.

Filed Under: Blog

Related Posts:

  • a red fire hydrant with two padlocks attached to it ssh key, terminal error, authentication agent
    Fix “Could Not Open a Connection to Your…
  • how-to-fix -there-has-been-a-critical-error-on-this-website-on-wordpress
    How to Fix “There has been a Critical Error on this…
  • what-is-instagrams-5xx-server-error-and-how-to-fix-it
    What is Instagram’s 5xx Server Error and How to Fix It?

Reader Interactions

Leave a Reply Cancel reply

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

Primary Sidebar

Recent posts

iPhone Home Button Not Working? Here’s how to fix it

Best Ways to Find Royalty Free Images for Blogging in 2025

Can You Play GameCube Games on Wii U? Explained

How to Change Notion’s Side Peek Setting

How to Find Out What Motherboard You Have

WordPress .htaccess File: A Beginner’s Complete Tutorial

How to Fix the “Not a Valid JSON Response” Error in WordPress

Promo Video Maker Software vs Online Tools: Which Is Better?

The Complete ReVanced VPN Review: Features, Pros, Cons, and Hidden Benefits

Lora AI Video vs Deforum: Which Delivers Better Animation Quality Under 30 FPS?

Footer

WebFactory’s WordPress Plugins

  • UnderConstructionPage
  • WP Reset
  • Google Maps Widget
  • Minimal Coming Soon & Maintenance Mode
  • WP 301 Redirects
  • WP Sticky

Articles you will like

  • 5,000+ Sites that Accept Guest Posts
  • WordPress Maintenance Services Roundup & Comparison
  • What Are the Best Selling WordPress Themes 2019?
  • The Ultimate Guide to WordPress Maintenance for Beginners
  • Ultimate Guide to Creating Redirects in WordPress

Join us

  • Facebook
  • Privacy Policy
  • Contact Us

Affiliate Disclosure: This page may have affiliate links. When you click the link and buy the product or service, I’ll receive a commission.

Copyright © 2025 · Reviewslion

  • Facebook
Like every other site, this one uses cookies too. Read the fine print to learn more. By continuing to browse, you agree to our use of cookies.X