Unable to write a new post using the Gutenberg editor in WordPress? The chances are you’re getting “The editor has encountered an unexpected error” in WordPress.
Gutenberg throws this error when a plugin or a piece of functionality code in your theme isn’t compatible with the Gutenberg editor. You can resolve this error by finding the faulty plugin or a code in your theme.
To do so, we’ll fire up the Inspect tool in Chrome and go to the Console tab to see which scripts are blocking the Gutenberg editor from loading.
Hover your mouse cursor over the first script that is being shown in the console to see the full URL of the script on your site. In our case, it was the following:
The above script is from the Yoast SEO plugin. This plugin recently received an update and that might have caused the issue with Gutenberg. To resolve the problem, you’ve two options:
- Contact the developer of the plugin to let them know about the issue with their plugin and the Gutenberg editor. And while the developer fixes the problem, rollback to the previous version of the plugin which worked fine with Gutenberg.
- Deactivate the plugin. If the plugin having issues with Gutenberg isn’t important for you, deactivate/uninstall it. Simple.
We were able to fix “The editor has encountered an unexpected error” in Gutenberg by rolling back to a previous version of Yoast SEO. But your problem could be with a different plugin. Just head over to the Console in Chrome to see which java-scripts are conflicting with the Gutenberg editor and try to fix them.