not knowing anything about json I can’t help further, except to say that there seem to be as many reasons for the error as there are sightings of the yeti.
Somehow you will need to improve this situation, as it seems to crop up all over the place.
variously it is fixed by
adding classic editor Now select the Classic Editor as the “default editor for all users” option, save your changes, and clear your website cache. Right after this, select the Block Editor as the default editor and again save the changes.
So I’m running my dev site locally and the only way to fix it was this. Settings > Permalinks > set to custom structure and then add this /index.php/%year%/%monthnum%/%day%/%postname%/
Do you happen to use Cloudflare by chance? If so, then most likely what’s happening here is the firewall is blocking JSON responses. When this happens, it will come back as a 5xx error. You could try temporarily disabling the firewall or the proxy altogether and see if the error goes away.
After testing at your hosting provider (WPMU DEV), and it does look like the issue is with the firewall (WAF).Using the browser tools Network tab, I see the request is blocked and there are instructions to go to the Hosting Hub to check the WAF logs.
Per the instructions in the log, you’ll need to whitelist your IP address or disable the rule.I whitelisted my IP address to just bypass the block and it worked.
occurs when uploading images
It’s pretty simple to get rid of this error and upload your images successfully.
Select Add Image from your Gutenberg block.
Now, instead of clicking on upload traditionally for uploading an image, Select Media Library.
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.
In my case it was due to a web server configuration (Apache2):
AllowOverride None
Changed it to :
AllowOverride All
in
/etc/apache2/apache2.conf
I had the same “not a valid JSON response” error when trying to publish my content. WordPress seems to do a JSON post when publishing a new post/page so I checked the network tab in my Developer Tools. If you check the “response” tab for this JSON call you might see some more details about this invalid JSON response.
In my case (yours might be different) some deprecated debug message was outputted before the actual JSON data and messed up the response. After fixing the deprecated message publishing worked again.
For me this error was shown in the backend editor because of a line of text in another file which echoed that line of text on each response. Incl. when WordPress internally made its own request expecting a JSON response. Once i removed that line issue disappeared.
If you are trying this on your local or production wordpress install you may likely get this error as your .htaccess file is not writeable for security reasons.
Error you will see in wordpress admin interface under permalink setting after you change from plain to any mode:
If your .htaccess file was writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.
Make sure your .htaccess file is writeable whenever you change your permalink setting from PLAIN mode to anyother mode like POST-NAME
I called my hosting provider (GoDaddy) and they said it was due to my Security Package not allowing my IP address to go through.
All I had to do was add my IP address to the firewall whitelist and then I was able to edit pages again!
and many many more