• Categories
    • Tutorials
    • Beginners Guide
    • WordPress News
    • WordPress Security
    • Best WordPress Plugins
    • WordPress Themes
    • Product Reviews
    • WP Tips & Tricks
  • Guides
    • Start a Blog
    • Make a Website
    • WordPress Hosting
  • WordPress Hosting
    • A2 Hosting
    • HostGator
    • Bluehost
    • Cloudways
  • Managed Hosting
    • WPEngine
    • Rocket.net
    • WPX
    • Kinsta
  • Coupons
    • WPEngine
    • Flywheel
    • Cloudways
    • A2 Hosting
    • WPX Hosting
WordPress Tutorials

How to Fix an Invalid JSON Error in WordPress

Last Updated on: June 8, 2022 Tom Rankin 1 Comment

How to Fix an Invalid JSON Error in WordPress

Unlike other errors, and invalid JSON error in WordPress is straightforward to understand and fix. For the unaware, this appears when WordPress can’t communicate with the web server while you work within the Block Editor. The server’s responses come in the JSON format, which explains the error.

Fixing the issue shouldn’t take more than a few minutes, and will be one of the following:

  • Figuring out whether something simple is the cause of the error.
  • Checking your WordPress URLs and altering them if necessary.
  • Adjusting your permalink settings, or at least rebuilding them.
  • Looking at the Site Health page within WordPress for clues on how to proceed.
  • Rebuilding your .htaccess file.

One of these will be the solution, although the hope is that you won’t need to look at all of them. We’re presenting the five solutions here from easiest to hardest, although that’s relative as you’ll likely have the skills you need to tackle each one in no time.

1. Carry Out Some Simple Steps to Diagnose the Error

Before you dig around in settings screens, you’ll want to ensure you aren’t the cause of the invalid JSON error in WordPress. However, create a full backup of your site first in case you need to reinstate your site later.

Once you have a backup in the bag, look to tick off all of the following ‘gotchas’:

  • Switch to a default theme, in case your primary one has a fault.
  • Turn off your Web Application Firewall (WAF), if you use one. It could be that you’ll disable your security plugin as a whole on a temporary basis.
  • Speaking of which, it’s a good idea to deactivate and reactive your plugins to see if one is the cause of the invalid JSON error in WordPress. This is a typical troubleshooting step within the platform, and can sometimes spotlight an issue with a rogue plugin.
  • Try using the Classic Editor, to see if you can still achieve what you need without seeing the error. However, you shouldn’t consider this a permanent fix, more scraping the rust off of a faulty engine.

If you don’t have WordPress’ debug mode active, you should also do this so you can try and catch the fault of the error. However, it’s likely going to be one of the below solutions, and they won’t take too long to resolve.

2. Check Your WordPress URLs

For the first method, you’ll want to log into WordPress and head to the Settings screen:

The WordPress Settings screen.

On the General tab, check out the two fields that read WordPress Address (URL) and Site Address (URL). In the vast majority of cases, they will be the same as the domain name for your site:

The fields for the WordPress Address URL and the Site Address URL.

You’ll likely know if your have WordPress under a different directory that would explain a clear difference here. However, a difference WordPress doesn’t understand will trigger the invalid JSON error.

It could be that those URLs use the wrong HTTP protocol: If you have a Secure Sockets Layer (SSL) certificate, each URL should use https://. Our advice is to check for spelling mistakes in each URL, and also check whether each ones uses the right protocol.

Once you make any fixes, save your changes and check for the error. If it still crops up, head to the next method.

3. Adjust Your WordPress Permalink Settings

While you’re in the Settings page, head to the Permalinks tab. There could be an issue under the hood with your permalink structure that could cause the invalid JSON error in WordPress.

Wordress' Permalink Settings screen.

The solution here is simple:

  • Choose a permalink type. Unless you use a Custom Structure, stick with the current option on this page.
  • Save your changes. This will ‘rest’ your permalink settings, and should rid you of the invalid JSON error in WordPress.

However, if you use a custom permalink structure, make sure there are no spelling mistakes or syntax errors with the tags you use:

The WordPress Post name and Custom Structure fields.

Even one character out of place will cause the error, so look to fix anything you spot, save your changes, and check for further issues.

4. Take a Look at the Site Health Log for Clues

WordPress includes a handy screen to help you judge how ‘healthy’ your site is. The Site Health page is essentially a list of critical issues and recommended improvements to help with aspects of your site. For example, you can optimize performance, work on your Search Engine Optimization (SEO), and more:

WordPress' Site Health screen.

If you encounter the invalid JSON error in WordPress, you may see another recommended improvement: “The REST API encountered an unexpected result”. This should give you some indication of where the JSON error lies, and from there you can investigate further.

However, if you don’t have much experience reading error logs like this, you might want to contact your host. This way, they can tell you what the issue pertains to, and whether it’s something on the server side.

5. Rebuild Your .htaccess File

The final method to solve the invalid JSON error in WordPress is the toughest, but still straightforward. Your .htaccess file is a set of configurations for Apache servers.

Unlike Nginx, Apache users can handle server configurations. As such, this could cause an invalid JSON error in WordPress.

The best approach here is to rebuild the .htaccess file itself, which is simple to do. In fact, you may have already done this when changing your permalink settings, as saving your changes here regenerates the .htaccess file.

However, you might want to create a clean file yourself from scratch, to be sure you don’t introduce an error or keep one around.

First, you’ll want to make a backup of your old .htaccess file. To do this, we recommend using Secure File Transfer Protocol (SFTP) to access your server and drag the .htaccess file to your local computer. Here’s what you’ll need:

Administrative access to your server, and the login credentials. You can often find these within your hosting control panel, or in an email from your host.

  • A suitable SFTP client, such as FileZilla, Cyberduck, or Transmit.
  • Knowledge of how to use SFTP, which we cover in a dedicated article on the blog.

Your .htaccess file will be in the root of your site’s primary directory, and the process is to drag it out onto your computer (and set for hidden files to show):

A SFTP client showing a WordPress directory that contains a .htaccess file.

From here, make a duplicate on your computer, clear out the contents, and add the following:

# BEGIN WordPress
 
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
 
# END WordPress

This is a default .htaccess file. Save it as .htaccess, then upload it to your server again. From here, check for the error.

Conclusion

The invalid JSON error in WordPress is simple to understand and fix, which is good if you need to continue working on your site in a hurry. Most of the solutions to this error relate to a configuration setting for your server, so you’ll poke around within WordPress’ settings screens to solve it.

In some cases, you’ll need to rebuild a .htaccess file from scratch, but even this is friction-free. However, if you still see the error on your site, it’s a good idea to contact your host for further advice. There could be something on the server that doesn’t play nicely with your site’s configuration that they will need to look into.

Do you suffer from the invalid JSON error in WordPress, and does one of our solutions help you? Let us know in the comments section below!

+ Share
Disclosure

Tom Rankin

Tom Rankin is a quality content writer for WordPress, tech, and small businesses. When he's not putting fingers to keyboard, he can be found taking photographs, writing music, playing computer games, and talking in the third-person.

Related Posts

Back to all articles
  • Dealing with WordPress RSS Feed Errors: How to Identify and Fix Them

    Dealing with WordPress RSS Feed Errors: How to Identify and Fix Them

  • What is WordPress? A Beginner's Guide!

    What is WordPress? What Can it do & Is it Right for You? A Beginner’s Guide

  • How to Set Up WordPress Two-Factor Authentication: WP 2FA Review

    How to Set Up WordPress Two-Factor Authentication: WP 2FA Review

Coupons

View more deals
  • 10% OFF

    Elegant Themes Coupon

    You can’t move within WordPress circles without coming across E
    Get This Deal
  • pressable logo
    15% OFF

    Pressable Coupon

    If you’re looking for a high-quality managed WordPress hosting
    Get This Deal
  • Teachable Coupon Code
    10% OFF

    Teachable Coupon

    Building an online course business requires the right platform to
    Get This Deal
1 Comment Leave a Reply
  1. Lauri Jakku says

    September 1, 2022 at 4:17 pm

    Hi, I got issue, that is not fixable by the tutorial(s) found on net.

    There’s extra ‘0’ in json or other mess.

    Can you help me ?

    Reply

Leave a Reply Cancel reply

Full Disclosure This post may contain affiliate links, meaning that if you click on one of the links and purchase an item, we may receive a commission (at no additional cost to you). All opinions are our own and we do not accept payments for positive reviews.

Our Newsletter

Get awesome content delivered straight to your inbox.

Thank you!

You have successfully joined our subscriber list.

.

THE BEST OF WPKUBE

Some of the best content we have published so far.

BEGINNER GUIDES & REVIEWS

110 Best WordPress Hosting Options for 2025 (Pros & Cons)
28 Best Managed WordPress Hosting Providers for 2025 Compared
38 Best Cheap WordPress Hosting Providers in 2025 (From $1.99)
46 Best WordPress LMS Plugins – Detailed Comparison & Review for 2024
55 Best WooCommerce Hosting Providers Compared in 2024 (All Budgets)
66 Best WordPress Landing Page Plugins Compared + Recommendations (2024)
79 Best List Building Plugins for WordPress In 2024
8How to Fix the 500 Internal Server Error on Your WordPress Website
9Beaver Builder Review: Honest Thoughts + Pros and Cons (2025)
10OptimizePress Review: Create Landing Pages with Ease
11How to Make a Website: Complete Beginner’s Guide
12Top 22 Best Free Stock Photo Resources For Your Site
13How to Start a Blog in 2022 (Step by Step Guide)
14How To Fix ‘503 Service Unavailable’ WordPress Error
1511 Best Contact Form Plugins for WordPress in 2025
16How to Add a Custom Logo to Your WordPress Site
17How to Fix Error Establishing a Database Connection in WordPress

Cloudways: 30% OFF Deal

Save 30% on one of the best cloud hosting providers.

Get this Deal
Featured In Forbes Huffpost Entrepreneur SEJ

About WPKube

WPKube is an online WordPress resource which focuses on WordPress tutorials, How-to’s, guides, plugins, news, and more. We aim to provide the most comprehensive beginner’s guides to anything about WordPress — from installing plugins, themes, automated installs and setups, to creating and setting up pages for your website.

We have over 500+ tutorials, guides, product reviews, tips, and tricks about WordPress. Founded by Devesh Sharma, the main goal of this site is to provide useful information on anything and everything WordPress.

Twitter Facebook

Useful Links

  • Behind the Scenes
  • Beginner Guides
  • WordPress Hosting
  • WooCommerce Themes
  • MeridianThemes
  • Exclusive WordPress Deals
View All Guides »

Reviews

  • WPEngine 33% OFF
  • WPX Hosting
  • Flywheel 33% OFF
  • Divi Theme 20% OFF
  • Systeme.io
  • Elegant Themes
Reviews »

Deals

  • InMotion Hosting
  • LifterLMS Coupon
  • LiquidWeb Coupon
  • WPEngine Coupon
  • A2 Hosting
  • Solid Affiliate
More Deals »
© Copyright 2023 WPKube ® All Rights Reserved.
  • Contact
  • Site Terms
  • Disclosure
  • Privacy Policy