While I was writing a blog post a couple of days, I realized an error appears says, the response is not a valid JSON Response in WordPress while uploading images.
Generally, plenty of errors can be discovered while uploading images in WordPress.
This was pretty much weird. Here is how it looks like!
It was new for even me. I had explored a few forums about the same, and most of the folks are facing this in recent days.
Image Uploading Fails in Gutenberg Editor
Though Gutenberg is being revolutionary and comes with plenty of features and Gutenberg block plugins are an ultimate add ons to the community. According to some folks, it’s a new WordPress Gutenberg error. Probably REST API didn’t work while uploading the images. And others have other reasons too.
But, who can wait for the updates and bug to be fixed?
Question is How do I solve ‘the response is not a valid JSON response in WordPress’?
We need a solution. While troubleshooting this issue. I had to check for an internal issue, I installed a plugin Health Check to dig what is causing it. But, that didn’t take me closer to the investigation.
Finally, I found two work around, both works good and you can get rid of that error.
Fix 1 – The Response is not a valid JSON response
It’s pretty simple to get rid of this error, and upload your images successfully.
Step 1. Select Add Image from your Gutenberg block.
Step 2. Now, instead of clicking on upload traditionally for uploading an image, Select Media Library.
Step 3. From this window, switch to the tab Upload Files – Select Files. And browse the image from your local drive.
Surprisingly this step will let you insert the images successfully without any error. 🙂
Though, it’s not a permanent solution but a perfect workaround if you don’t want to stop your work until WordPress releases their next update or patch.
If you would like to have all the permanent image error solution. The next method will solve the error response is not a valid JSON response.
Method 2 – Avoid Error While Uploading the Images in WordPress
This is even simple, all you need to do is install a plugin available in Github and the error will be no more.
Step 1. Download Default to GD plugin WordPress Plugin
Step 2. Install the plugin in your WordPress Site..
Step 3. You are all set no changes required at all.
Do you like the trick to upload your images?
I have tried this above method personally on my site, and both worked for me. I now got rid of the response is not a valid JSON response error.
In fact, the plugin method will solve all the image error happens while uploading a picture on your WordPress site.