How to Fix The Invalid JSON Error in WordPress (Beginner’s Guide)

1 month ago 32

Are you trying to hole the invalid JSON mistake successful WordPress?

This mistake appears erstwhile editing WordPress posts oregon pages connected your website. You’ll spot a connection saying ‘The effect is not a valid JSON response’ and updating that leafage would fail.

In this article, we’ll amusement you however to easy hole the invalid JSON mistake successful WordPress. We’ll besides speech astir wherefore this mistake occurs and however to debar it successful the future.

JSON effect   is not valid mistake  successful  WordPress

What causes ‘Not a Valid JSON Response’ Error successful WordPress?

Failure to person an expected effect from the server causes the ‘Not a valid JSON response’ mistake successful WordPress.

Basically, WordPress needs to pass with the server portion you are editing a blog post. It relies connected getting responses from the web hosting server successful the background. This effect is usually successful JSON format which is utilized to rapidly transport information utilizing JavaScript.

If for immoderate reason, WordPress fails to get the response, oregon the effect is not successful JSON format, past you’ll spot the ‘Not a valid JSON response’ error.

Not valid JSON effect   mistake  displayed successful  WordPress

This mistake could look for a fig of reasons. However, the astir apt origin of it to hap is incorrect URL settings successful WordPress oregon breached permalinks.

That being said, let’s instrumentality a look astatine however to easy hole the invalid JSON mistake successful WordPress.

Important: Please marque a complete WordPress backup earlier making immoderate large changes to your website. This allows you to easy reconstruct your website to the erstwhile state.

1. Check WordPress URLs successful Settings

First, you request to marque definite that your WordPress Address and Site Address settings are correct.

Simply, spell to Settings » General page. From here, you request to reappraisal the WordPress Address (URL) and Site Address (URL) fields.

WordPress URL settings

For astir websites, this mounting needs to person the aforesaid URL successful some fields.

However, rarely, immoderate users whitethorn person fixed WordPress its ain directory and service the website connected a antithetic address. In that case, they tin person antithetic URLs here.

However, if your Site Address is incorrect past that would trigger the invalid JSON mistake successful WordPress.

If you made immoderate changes to the settings, past don’t hide to click connected the Save Changes fastener to store your settings. You tin present edit a blog station and spot if adding immoderate caller blocks oregon redeeming that station triggers the ‘Not valid JSON response’ error.

If you are inactive seeing the error, past proceed reading.

2. Fix WordPress Permalink Structure

WordPress comes with SEO affable URL structure that allows you to usage human-readable URLs for your posts and pages.

However, sometimes a idiosyncratic whitethorn messiness up the permalinks settings. This would marque it intolerable for the WordPress exertion to get a valid JSON effect and origin the mistake to amusement up.

To hole this, you request to simply sojourn Settings » Permalinks page. From here, you request to cautiously reappraisal the permalink options.

Fix permalinks successful  WordPress

If you are unsure whether you are utilizing the close settings, past simply prime 1 of the default formats available.

After that, spell up and click connected the Save Changes fastener to store your settings.

You tin present effort editing a blog station oregon leafage to spot if the mistake has disappeared. If it hasn’t, past you tin effort this adjacent step.

3. Regenerate WordPress .htaccess File

The .htaccess file successful WordPress is utilized arsenic a configuration record to negociate SEO-friendly URLs (permalinks).

Normally, WordPress tin automatically regenerate and update it. You tin besides trigger that update by simply clicking connected the Save Changes fastener astatine the bottommost of Settings » Permalinks page.

However, sometimes it whitethorn not get updated oregon has incorrect settings. This would impact your WordPress permalinks and whitethorn besides origin an invalid JSON effect error.

To hole this, you request to link to your website utilizing an FTP lawsuit oregon the record manager app successful your WordPress hosting relationship dashboard.

Once connected, you request to find the .htaccess record successful the basal folder of your website and download it arsenic a backup to your computer.

Download .htaccess record  arsenic  a backup

Tip: Can’t find .htaccess file? See this speedy nonfiction connected how to find .htaccess file.

After that, you request to edit the .htaccess record utilizing FTP lawsuit oregon the record manager app.

Edit .htaccess record

Once the record opens, you request to delete each the codification wrong it and regenerate it with the pursuing code:

# 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

Don’t hide to prevention your changes and upload the record backmost to your website.

You tin present sojourn your website and edit and station oregon leafage to spot if you tin reproduce the invalid JSON effect error.

If you are inactive seeing the error, past determination are a fewer much steps you tin take.

4. View The Rest API Debug Log

The invalid JSON effect mistake would besides mean that WordPress REST API connected your website encountered an error.

The REST API is the acceptable of techniques WordPress uses to pass with the server arsenic you enactment connected your website.

You tin spot details of this mistake successful the WordPress Site Health tool. Visit the Tools » Site Health page.

REST API contented   successful  WordPress

From here, you whitethorn spot an contented labeled ‘The REST API encountered an unexpected result’.

Clicking connected it volition amusement you much details which whitethorn springiness you immoderate clues astir which plugin oregon third-party work whitethorn beryllium causing the issue.

If this doesn’t supply immoderate clue, past you tin determination connected to the adjacent step.

5. Deactivate All WordPress Plugins

Occasionally, WordPress plugins whitethorn struggle with each different oregon the WordPress core. This could effect successful unexpected behaviour and could beryllium a imaginable crushed for the invalid JSON error.

Simply spell to the Plugins » Installed Plugins page. From here, prime each your WordPress plugins and past take ‘Deactivate’ nether the Bulk Actions driblet down menu. Now, click the Apply fastener to continue.

Deactivate each  plugins

WordPress volition present deactivate each your installed plugins.

You tin present effort again to reproduce the error. If the mistake disappears, past this means 1 of the plugins installed connected your website was causing it.

To fig retired which plugin, you request to activate them 1 by 1 and past effort to reproduce the error. Repeat this until you find the culprit.

After that, you tin scope retired to the plugin writer for enactment oregon find an alternate plugin.

6. Temporarily Switch to the Classic Editor

If each the supra steps fail, past you tin temporarily switch to the Classic Editor for WordPress.

This older mentation of WordPress exertion uses a simpler substance exertion and doesn’t trust heavy connected REST API to get JSON response.

To usage it, you request to instal and activate the Classic Editor plugin. For much details, spot our measurement by measurement usher connected how to instal a WordPress plugin.

The plugin works retired of the box, and it volition disable the Gutenberg exertion upon activation.

You tin present proceed moving connected your website and get backmost to the troubleshooting later.

7. Further Troubleshooting

A fig of things tin artifact WordPress REST API oregon marque it instrumentality an invalid JSON response. We person addressed the astir apt culprits above, but if that didn’t hole it for you past present are immoderate much steps that you tin try.

Switching to a Default WordPress Theme

Sometimes a struggle betwixt your WordPress taxable and a plugin oregon the WordPress halfway whitethorn effect successful unexpected behavior.

You tin trial this, by simply switching to a default WordPress taxable similar TwentyTwentyOne oregon Twenty-Twenty.

Temporarily Turn disconnected Website Application Firewall

If you are utilizing a WordPress firewall similar Sucuri, Cloudflare, oregon a plugin, past it is imaginable that they whitethorn sometimes artifact morganatic requests too.

The easiest mode to fig this retired is by temporarily disabling your WordPress firewall plugin oregon service.

Some application-level WordPress firewalls tin beryllium disabled by simply deactivating the plugin. For DNS level firewalls similar Sucuri and Cloudflare, you tin disable them from your relationship dashboard.

Turn connected Debugging successful WordPress

WordPress comes with a built-in diagnostic that allows you to support a log of errors. However, it is not enabled by default.

To crook it on, you request to adhd the pursuing codification to your wp-config.php file:

define( 'WP_DEBUG', existent ); define( 'WP_DEBUG_LOG', existent );

After that, WordPress volition support a log of each errors successful a debug.log record located wrong /wp-content/ folder. You tin entree this record by utilizing an FTP client.

The mistake log whitethorn supply you a hint astir what whitethorn beryllium causing the invalid JSON mistake connected your website. For much details, spot our usher connected setting up WordPress mistake logs and utilizing them for debugging errors.

Seek Expert Help

Finally, if each other fails, past this could beryllium owed to a misconfiguration connected your WordPress hosting server. Most reliable WordPress hosting companies are capable to assistance users with communal WordPress issues similar that.

Simply scope retired to them via unrecorded chat oregon enactment summons and they whitethorn beryllium capable to assistance you hole it.

We anticipation this nonfiction helped you larn however to hole the invalid JSON mistake successful WordPress. Let america cognize which solution worked for you successful the comments below.

You whitethorn besides privation to spot our implicit handbook of the most communal WordPress errors and however to hole them.

If you liked this article, past delight subscribe to our YouTube Channel for WordPress video tutorials. You tin besides find america connected Twitter and Facebook.

Original Story