Fixing: “response-is-not-a-valid-json-response-error”

First of all, let’s try to know what kind of error it is:

In Block editor, known as Gutenberg, the error message “The response is not a valid JSON response.” is obtrusive. If you edit a post or a page on your WordPress website, this error will appear. In spite of Gutenberg being revolutionary and coming with a lot of functionality, Gutenberg block plugins are must-haves for the community.

The WordPress blog editor communicates with the server when you edit a post. The web hosting server must respond in the background to get responses. Typically, the response is in JSON format, which is used for fast data transfer using JavaScript. In some cases, WordPress may not be able to get the response, or it may not be in JSON format, so you will see the ‘Not a valid JSON response’ error.

The fixes to “response-is-not-a-valid-json-response-error”

But if you are countering this error message while uploading the images, don’t worry here we have with us the fixes of this error which can drastically ease out your problem.

Fix 1:

The easiest fix to this error is here for you!

In your Gutenberg blocks, select add image block. Here there will be three options available to you.

That is, you can upload images, or media library or can insert images from url. Usually, we click on upload images button in order to upload pictures from our computer. But while doing this, many users encounter “The response is not a valid JSON response”. So, to solve this click on media library button and a new window will open up. Now on this window, just switch the media query tab to upload files tab and browse and select files from your own computer. However, it is a temporary workaround if you don’t wish to wait until WordPress releases their next update. if you want all of the permanent solution for image errors. Next solutions can be proven very useful to you.

Fix 2:

Double check the url of your WordPress site in the settings section.

Go to the general page under settings of WordPress portal and review the WordPress URL address and site url address. Most websites need to have same url in both the above-mentioned fields so if your site address is not correct then this could raise the error message “The response is not a valid JSON response.”

Fix 3: 

If you are still getting the error message while having same url in both the WordPress URL address and site url address field then this fix may work for you.

This solution is all about fixing your permalinks. Your WordPress posts and pages have a human-readable URL structure that is SEO friendly. The problem can occur, however, if a user messes up the permalinks setting. The editor would not be able to get a valid JSON response, resulting in the error to appear. So to fix this, Go to the permalinks page under settings of WordPress portal. Default formats are available for those who are not certain that these settings are right. Then click the Save Changes button to keep your settings. To check whether the error has been cured, edit a blog post or page. The next step can be tried if it hasn’t already.

Fix 4:

It is also possible that REST API on your WordPress website encountered an error and that’s why you are encountering the “The response is not a valid JSON response.” error. When you work on your website, WordPress communicates with the server using the REST API. The WordPress Site Health tool provides details regarding this error. For this, go to the Site Health page under tools section of WordPress portal. A message may appear here to indicate that ‘REST API encountered unexpected results’. Depending on which plugin or third-party service is causing the issue, its display will provide more details. You may move on to the next step if this gives you no clue.

Fix 5:

Disable all plugins on your WordPress site. There may be times when WordPress plugins interfere with each other or the WordPress core. There is a possibility for unexpected behaviour and for an invalid JSON error to result. Go to the Installed Plugins page under plugins section of WordPress portal.

Now select all the activated plugins of WordPress and then choose “deactivate” available as drop-down option and then finally click apply button. All plugins installed on your WordPress site will now be deactivated.

Please try reproducing the error again now. A plugin installed on your website is the likely culprit if the error vanishes. Activate each plugin individually and then attempt to reproduce the error to determine which plugin caused the problem. This process should be repeated until you identify the culprit plugin. If the plugin author cannot help you after finding this, you can find an alternative plugin.

Fix 6:

Just head over to GitHub and search for “Default to GD plugin” and download this WordPress plugin from GitHub portal. This plugin will be in the .zip format. After having downloaded the plugin, all you have to do is to install that plugin in your WordPress site. That’s it! You are all set to update your WordPress website without facing any technical glitches.

Conclusion:

If any of the above solutions cannot help you to get rid of this “The response is not a valid JSON response.” Error message then you should switch back to the classic editor on WordPress. Your switch will be a temporary one as you can always get back to the currently used editor version once it gets fixed by the WordPress team.

Leave a Comment

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