So you’ve just updated your WordPress software and now when you’re trying to edit one of your articles, WordPress throws you this error message: “The editor has encountered an unexpected error”.
Now that you’ve come here, forget all your worries as in this article I am going to show you how to fix this annoying unexpected error, so that you can get back to editing that awesome piece of content as soon as possible!
Let’s discuss one thing first. I know that there are many sites and forums out there where people are saying that installing the classical editor will fix this problem, but that’s not a legit solution. In fact, this problem is not due to any bug.
What Causes This Error?
This error is caused due to the old cache files that your site is still serving you, even after WordPress has been updated to the newest version. To fix this error, we must purge all the cache from all the installed plugins, CDN and the hosting site.
Follow the step by step guide given below to fix the issue.
Steps To Fix The “The editor has encountered an unexpected error” Issue In WordPress
1. Purge The Cache From Cloudflare Or Any Other CDN That You Use
If you use Cloudflare or any other Content Delivery Network service, you need to delete the cache from their side.
Here I will show how to purge the cache from Cloudflare. But if you use some other CDN, then simply Google search “How to delete cache on (name of your CDN service provider)” and follow that tutorial. If you do not use any CDN, skip this step.
First of all, login to your Cloudflare account and select your website.
Now go to the Caching option and click on Purge Everything.
2. Purge Cache From Your WordPress Plugin
Now, login to your WordPress dashboard and depending on what cache plugin you’re using, clear all it’s cache accordingly.
If you’re not sure how to delete the cache from your cache plugin, Google search “How to delete cache from (name of your cache plugin)”.
In this example, I will show you how to delete the cache from the WP Super Cache Plugin.
For WP Super Cache, simply login to your dashboard and from the top toolbar, click on “Delete Cache“
Delete Cache From Your Hosting (Optional Step)
If you use any of these hosting providers: Bluehost / SiteGround / A2 Hosting / Hostgator / GoDaddy or any other hosting provider that provide built-in caching support, you need purge that cache.
For Bluehost Users
Login to your Bluehost account. Go to hosting –> performance –> cache control and click on clear all cache.
For SiteGround Users
Login to your SiteGround account. Go to WEBSITES –> SITE TOOLS –> SPEED –> Caching and turn it OFF. Then wait for 10 seconds and turn it back ON.
For A2 Hosting Users
If you’re a A2 Hosting user and you use the LiteSpeed Cache, go to the Manage page of LiteSpeed plugin and click on Purge All.
For Hostgator Users
Only if you’re using the managed WordPress hosting on Hostgator, contact their customer support and ask them to purge your cache.
Don’t need to do anything if you’re using some other plan.
For GoDaddy Managed WordPress Hosting Users
If you use Managed WordPress Hosting from GoDaddy, see this tutorial for clearing the cache: https://in.godaddy.com/help/clear-your-cache-12444
If you’re using any hosting other than those mentioned above, kindly Google search “How to delete cache in (your hosting provider name)”.
That’s it! Now the problem in the WordPress editor should have been fixed. However, if it still shows the error, you need to clear your browser’s cache.
3. Clear Browser Cache (Optional)
If even after following the above mentioned steps the error doesn’t go away, please clear the cache from your browser.
Follow this article to learn how to clear your browser’s cache: https://www.digitaltrends.com/computing/how-to-clear-your-browser-cache/
For 99% of users, the problem should have been solved now. If the error in your WordPress still persists even after following all the above steps, then you’re the remaining 1% of the users.
So, if your problem still persists, there’s a last extra step that you need to follow.
Extra Step For 1% Of The Users Whose Problem Still Persists
Login to your WordPress dashboard and go to Plugins –> Add New and then install and activate the Classic Editor plugin.
Now try editing the old posts. You will see that now the posts open in the Classic Editor.
Now in the Classic Editor, at the right-hand side, you will see the option Switch To Block Editor. Click on it. The error should be gone now.
However, if it still exists, here’s what you need to do next:
Fixing Plugin Conflicts
I recently found out that this problem is sometimes also caused by some 3rd party plugin conflicts, usually after they receive an update.
If none of the above method works, you need to find out if there’s a 3rd party plugin installed on your site that’s causing the problem, or not.
Here’s how to do that:
Make sure you do this at the time of the day when your site receives the least amount of traffic.
Take A Backup
If your host natively supports daily automatic backups, you can skip this step.
Go to Plugins –> Add New and search for “updraftplus”.
Install and Activate the plugin.
Now go to Plugins –> UpdraftPlus Settings and hit the big Backup Now button.
Turn On Maintenance Mode
During the process of finding the plugin which is the actual culprit, we would have to deactivate some plugins and that can cause your site to load improperly when a visitor tries to access it.
Thus, it would be the best to let the visitor know that your site is undergoing maintenance.
To do that, go to Plugins –> Add New and search for “One Click Maintenance Mode“.
Install and Activate the plugin.
You site will get into Maintenance Mode. Visitors (users not logged in as administrator) will see the following message.
Find The Culprit Plugin
Now it’s time to hunt down the plugin that is actually causing this issue.
Go to Plugins and deactivate the plugins one by one. Not all at once.
After deactivating each plugin, go back to your post editor (make sure you refresh) and check if it works.
In this way, you will be able to find out the culprit. After the plugin which is causing the “The Editor Has Encountered An Unexpected Error” issue has been found, simply delete it and activate all the other plugins.
Now turn off the maintenance mode (by deactivating the One Click Maintenance Mode plugin) and clear your cache one more time.
The issue should be fixed now!
You may contact the developer of the plugin which is causing the problem asking for a fix so that you can later use that plugin, if it’s important to you and serves a core function.
I hope this article was helpful to you.
It takes a lot of time to create these articles and I would really appreciate it if you consider sharing them with your friends.
If you face any problem regarding this topic, feel free to comment down below and I will surely help you out.
If you were able to solve the same problem in a different way which is not shown in this article, please leave a comment discussing it so that it can be helpful for others too.
Do let me know in the comments what do you think about this guide.
See you in the next article!
Have a great day ahead! 🙂