Archived topic
Updating failed. Error message: The response is not a valid JSON response.
15 replies · Started by Michael on March 24, 2020
Hi guys,
Please can you help me work out what is causing the following error when I try to save or update a post?
Updating failed. Error message: The response is not a valid JSON response.
I checked Site Health and it said this is OK.
I reinstalled WP but that didn't help.
I deactivated all plugins and that didn't help either.
I tried making another post but get the same error.
I don't know what else to try to solve this and would really appreciate your assistance.
Thank you very much.
Michael.
Hi there,
Do you get the same issue when using a twenty series default theme?
I see quite a few solutions when googling "Updating failed. Error message: The response is not a valid JSON response when saving a post". Have you tried any of them yet?
Hi Leo, I have been testing and right now have narrowed it down to in the inclusion of iframe code within the html content of block editor. If I remove this code, the save works. This is really weird because the iframe code is a YouTube embed so should be legitimate? Is this something you could advise me how to fix? Sorry for the confusion - this stuff drives me bonkers. I am using the latest version of WP with the Gutenberg Block Editor.
<iframe width="560" height="315" src="https://www.youtube.com/embed/OLes-Mc5JwA" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
What if you try the YouTube embed block?
We really need to make sure the questions are theme related.
Sure Leo - I understand. My problem was I couldn't work out if it was theme related or not. I installed the classic editor and it saved the iframe, so I guess there must be a bug in the block editor.
The easiest (and basically the only) way to determine if it's a theme problem or not is to switch to a twenty series default theme and see the problem exists there.
Glad you were able to figure out :)
Hi Leo, one of the moderators on the WordPress forum said he added the iframe code on a vanilla theme and it worked without error, so he reckons it might be a problem with the theme. Please can you explain if there is any danger for me losing stuff or anything like that if I switch theme to test myself? I have 2020 installed, but am a bit nervous of breaking the site.
It's always to keep a backup of your site.
But no nothing will break when you switch themes :)
I also just gave this a go and didn't encounter any issues:
https://www.screencast.com/t/fqutlH8L
Hi Leo,
Thanks for getting back to me. Hmmm, bizarre. I had the same issue when I had to add a bit of javascript to a page a few weeks back. It also generated the JSON error. So iframe and jscript cause it, but it's not theme related, and turning off the plugins doesn't make any difference. Can you please recommend how else I might determine what is causing this?
Hi there,
so your iframe code works fine in all of my tests with the GP Theme which says something is different in your site configuration.
Right Click and Inspect the editor before saving and then save to see if any Red errors appear in the Console. This may help point to the cause of the problem.
Hi David, thanks a lot for the suggested course of action. I will try that now :)
Hi David,
This is what the console reads:
15:20:18.564 This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”. post-new.php
15:20:18.800 JQMIGRATE: Migrate is installed, version 1.4.1 load-scripts.php:8:552
15:20:23.753 uncaught exception: Object
15:20:24.431 MouseEvent.mozPressure is deprecated. Use PointerEvent.pressure instead. tinymce.min.js:2:9108
I can't see any other info or logs
None of them look related to the issue unfortunately.
I see quite a lot these 'errors' raised on WordPress.org - a lot of which are related to URLs, HTTAccess rules etc. Something that we can't really help with i am afraid.
No problem David. Thank you for trying.