WordPress

FIX: “The editor has encountered an unexpected error” in WordPress after update

Unable to write a new post using the new Block Editor in WordPress? The chances are you’re getting “The editor has encountered an unexpected error” in WordPress.

Block editor throws this error when a plugin or a piece of functionality code in your theme isn’t compatible with the Block 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 block 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:

.../wp-content/plugins/wordpress-seo/js/dist/wp-seo-post-scraper-810.min.js?ver=8.1

The above script is from the Yoast SEO plugin. This plugin recently received an update and that might have caused the issue with Block editor. 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 Block editor. And while the developer fixes the problem, rollback to the previous version of the plugin which worked fine with Block.
  • Deactivate the plugin. If the plugin having issues with Block editor isn’t important for you, deactivate/uninstall it. Simple.

We were able to fix “The editor has encountered an unexpected error” in Block editor 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 Block editor and try to fix them.

3 Comments

  1. there was one draft in my older version of wordpress.today i updated my wp to 5.0 and now when i am trying to edit that draft. its showing “The editor has encountered an unexpected error.” is there any way to rollback wp to older version ?

    • Shivam Reply

      You can rollback WordPress to an older version but it’s a tedious process. The reason you’re seeing the error is because WordPress 5.0 comes with a new block-based Gutenberg editor. So why not find what JavaScript is crashing the Gutenberg editor using the tips shared above? Or if you want the classic editor back, follow the guide at the link below:

      https://allthings.how/install-use-classic-editor-disable-gutenberg-wordpress/

Leave a Reply

%d bloggers like this: