SOLVED: WordPress “invalid JSON response” error
Troubleshooting the “invalid JSON response” error in WordPress? The workaround in this blog post is essential reading.
This blog post is intended for WordPress beginners. It will guide you step-by-step through the process of installing the classic editor plugin, configuring WordPress to allow switching between editors, and then, when the JSON error prevents your from editing your post or page, how to copy changes from the block editor to the classic editor.
There are many blog posts discuss the JSON error in WordPress, but these are focused on troubleshooting the problem to discern which plugin, theme, or incorrect setting is causing it. For many WordPress users, however, this error occurs but can’t be traced back to one of these causes, suggesting the problem is in WordPress itself related to the Block Editor. This blog posts simply describes the workaround allowing the user to swtich to the classic editor when the JSON bug rears its ugly head. It’s not really a fix, just a workaround.
If you haven’t tried the remedies proffered at WPBeginner and elsewhere to narrow down the cause of the Invalid JSON Response error and you would like to, this post at HubSpot is a good place to start. If you have tried these fixes already and the JSON error persists, this article describes a workaround that will get you publishing again.
We know that the Invalid JSON Response error only affects users working in the block editor. This workaround installs the classic editor and allows users to toggle back and forth between the two. It’s an inelegant and time intensive process but an easy one that seems to usually work.
Workaround Steps
- Install the Classic Editor plugin. If your’e using multisite, navigate to your Network Admin plugins section and click the Add Plugin button. Search for Classic Editor and select the one by WordPress Contributors. Click Install Now and then click Activate.
- From your Network Admin account select Settings in the left menu then select Network Settings. Scroll to the bottom and select Block Editor to be the default editor. Then select the checkbox to allow site admins to change settings.
- Navigate back to the dashboard of the website experiencing the JSON error. Go to Settings in the left menu bar, then select Writing Settings. Ensure that block editor is the default and click the radio button to allow users to switch editors.
- In your affected post or on your affected page, edit it using the default block editor. Make the changes that result in the JSON error. You can attempt to commit the changes to the server again to confirm the bug is still in effect. That’s okay. On the top right side of the page, click the three vertical dots to bring up a menu for the WordPress editor preferences. Click on Code Editor.
- In the code editor, place your cursor into the block of code and press CTRL+A or CMD+A to select all of the text then CTRL+C or CMD+C to copy the code.
- Click the three dots again in the upper right of the screen. Select Switch to classic editor. Then click the Text tab in the upper right corner of the post or page edit box. This will bring up the code editor. Select the code that’s in place and replace it with the contents of the clipboard by using the Paste command. Click Update.
- And that’s it! To check that your edits were as you intended, clear your site cache then launch a separate web browser and check for yourself. Commence being productive again. No need to thank me, but if you want to do so, that’s why God created the Comments section, below.