WordPress: Fix ‘The editor has encountered an unexpected error’

After upgrading WordPress to the newest version, I received the following error message when trying to edit pages and posts in the WordPress dashboard:

The editor has encountered an unexpected error.
TypeError: Cannot read property 'DotTip' of undefined

I am presented with three options/buttons: Attempt Recovery, Copy Post Text, Copy Error.

Very strange to see such as error, because most of the times, WordPress is quite a stable content management system that is thoroughly tested before it is released to the public. I had to search a bit and do some trial and error, but in the end I found the culprit that solved this error message.

Find below the different steps you can try out in order to also solve this issue on your WordPress installation so that you can again edit your posts and pages without being blocked by this error message.

Option 1: Disable conflicting plugins

Very often, the plugins that you have installed and enabled in WordPress cause issues. Especially plugins that are made by third-party developers (non-Wordpress.org) are sometimes not well tested with newer versions of WordPress.

Disable the plugins one by one, so that you can eliminate the plugins that are not at fault.

Option 2: Edit wp-config to disable script concatenation

In the root of your WordPress installation, find the file ‘wp-config.php‘, open it and add the following line of code at the very bottom:

define(‘CONCATENATE_SCRIPTS’, false);

This small piece of code will disable the concatenation of scripts in WordPress. By default, the different scripts are merged into one file in order to lower the number of HTTP calls. This may be the issue that prevents you from editing posts and pages. This script will only apply to the admin area (and will not affect your actual WordPress website that is served to visitors).

Option 3: Verify script query string

By default, WordPress is adding a little bit of information at the end of every script that contains the version information of WordPress. Example: example.org/script.js?v=5.4 URL will indicate the version of the script.

On my end, I removed the query string via the ‘functions.php‘ file (can be found in the theme directory) in line with optimisation recommendations on site speed and performance.

I removed the following lines of code in the functions file:

function _remove_script_version( $src ){
return add_query_arg( 'ver', false, $src );
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );

Simply refreshing the WordPress edit page then showed me that the issue was fixed.

Final option: Install the Classic Editor

Still no luck? Then maybe installing the Classic Editor solve the issue for you. This is the editor that was previously used inside of WordPress by default, and is now replaced by the Gutenberg editor.


Author Bio

Thank you for your interest in my blog! On this miniblog, I write mostly short (technical) blog posts that might interest other people. Read more about me or feel free to contact me.


5 thoughts on “WordPress: Fix ‘The editor has encountered an unexpected error’

  1. Hey,
    Found this when looking for solutions to the error.

    I also received that error and was reluctant to try anything that you mentioned above. Someone else mentioned that the problem went away once they switched browsers.

    I was having the error in Chrome, and for me, it went away when I logged in through Microsoft Edge.

    Hopefully that can be a quick fix for someone else in a similar situation.

  2. It was eating much of my productive time and frustrating to see one of my post got this error message.
    Finally I just had to switch between the classic editor and the block editor (after installing the Classic Editor plugin). Ended up to have the post content as classic section blocks, so I can come back anytime to edit it if I need to.

    I think the problem was started when I added animation FX to a heading block, which I forgot if that was part of a block plugin that I might uninstall it, so it got sort of messy and conflicted with the stuffs in the code editor.

    Thanks for sharing this useful tips Thomas! :)

  3. I came across this same Error on one of my websites. After several troubleshooting, i must confess that the problem only came from Chrome Browser. The error went away immediately i tried it on another browser.

    Note however that my other websites that were opened at the same time on Chrome were not experiencing the error. Only one out of THREE DID.

    Nice job!

Leave a Reply

Your email address will not be published. Required fields are marked *