Are you seeing a critical error on your WordPress site?
WordPress in some cases shows you a message that “There has been a critical error on your website. Please check your site admin email inbox for instructions.” It will also include a link to debug in the WordPress manual.
In this guide, we will show you how to fix a critical error in WordPress easily. We will also talk about what causes this error and how to avoid it.
What is a Critical Error in WordPress?
A Critical error in WordPress is an error that causes WordPress to not load all the scripts it needs to run properly.
Previously, this WordPress error resulted in a white screen of death or a fatal error message on the screen. Most newbies didn’t find it very helpful and struggled to fix the problem on their own.
Starting with WordPress 5.2, users will now see a generic error message “There has been a critical error on your website. Please check your site admin email inbox for instructions.” with a link to the WordPress debugging guide.
It will also send an email to your WordPress site administrator with more details about the error and a link to access the WordPress Dashboard in recovery mode.
What Causes Critical Errors in WordPress?
A critical error in WordPress is usually caused by a faulty plugin, script, or code that prevents WordPress from functioning properly.
WordPress won’t be able to load the rest of the files it needs if you don’t fix this issue.
If you have recently copied and pasted code snippets from some tutorial into your website, it may cause a critical error.
All the best WordPress plugins are extensively tested so they are less likely to cause a critical error on their own. However, a conflict with another WordPress plugin or some custom code can cause an error.
However, let’s see how easy it is to fix a critical error in WordPress and get your site back.
Fixing Critical Error with WordPress Debug Email
First, you need to go to your inbox for the email address you use as your WordPress admin email on your website.
Don’t know which email address you used as your admin email? This is the email address you provide when installing WordPress.
If you are on Bluehost or have used the WordPress auto-installer, then your admin email address will most likely be the same address you used for your WordPress hosting account.
In your inbox, you will see an email with the subject line “Your Site is Experiencing a Technical Issue”. You will find much more useful information about what caused the critical error on your WordPress site Inside it.
For example, in the following screenshot, you can see that the crash was caused by a WordPress plugin on our test site.
The email also contains a special link that will allow you to log into your WordPress website in recovery mode to fix and investigate the issue.
At the bottom of the email, you’ll see even more detailed information about the error, including the specific file and code that caused it.
Now you just need to click on the WordPress recovery mode link which will take you to your WordPress admin area.
You will be prompted to sign in to continue.
As soon as you log in, you will see a notification informing you of a critical error, what caused the error, and a link to a place where you can go to fix it.
You can go ahead and disable the plugin for now.
You can then just look for an alternative WordPress plugin or see if you can get support from the plugin developers.
Similarly, if the issue is related to your theme, you will see a link to the Themes page. At the bottom of the page, you can see the topic that caused the problem.
You can simply change your WordPress theme or remove the broken theme and reinstall a fresh copy of the same theme from the official source to see if that solves the problem.
Once you fix the problem, you can simply continue and click on the Exit Recovery Mode button at the top.
In most cases, your WordPress site will now start working normally.
Fixing a Critical Error in WordPress Manually
If you didn’t receive the Critical WordPress Issue Notification email, then here’s how you can troubleshoot and fix the WordPress Critical Error.
If the error was caused by a recent action you took, you can simply undo that action to fix the problem.
For example, if you installed a new plugin and its activation caused a critical error, you need to deactivate that plugin.
On the other hand, if you are unsure, then you can simply follow these steps.
Deactivate All WordPress Plugins
The easiest way to disable a faulty WordPress plugin is to disable it. However, due to a critical error, you don’t have access to the admin area and you don’t know which plugin to disable.
To resolve this issue, we are deactivating all WordPress plugins. Don’t worry, you can easily activate them once you have access to your WordPress admin area.
Simply connect to your WordPress website using an FTP client or file manager app in your WordPress hosting control panel.
Once connected, you need to navigate to the /wp-content/ folder.
Inside the wp-content folder, you will see a folder called “plugins”. You need to right-click on it and then select the “Rename” option.
Then change the name of the plugins folder to whatever you like. In our example, we’ll call it “plugins.deactivate”.
Once you do this, all your plugins will be deactivated.
Basically, WordPress looks for the plugins folder in order to upload activated plugins to your site. When it can’t find the plugins folder, it simply fails to activate the plugins and automatically sets them as deactivated.
You can now visit your website to see if the critical error message has disappeared.
Important: Whether the critical error issue is resolved or not, remember to rename the plugins. The deactivated folder is returned to the ‘Plugins’ section. WordPress will then recognize the folder and you will be able to re-activate them one by one from the WordPress dashboard to determine which one caused the critical error.
Switch to the default theme
The next step in fixing a critical error is to switch your WordPress theme back to the default theme. This will fix the critical error issue if it is caused by some code in your current WordPress theme.
Simply go to the WordPress.org theme directory and download a fresh copy of the twentytwentyone or twentytwentytwo WordPress theme.
Next, you need to extract the theme file to your PC. This will create a folder named theme on your computer.
Now you need to connect to your WordPress site using an FTP client or the file manager app in your hosting control panel. Once connected, navigate to the /wp-content/themes folder and you will see a list of all the themes installed on your website.
Go ahead and download them all to your computer as a backup. After that, you need to remove all theme folders from your site.
Your WordPress site no longer has a theme installed. To fix this, go ahead and download the default theme folder you downloaded earlier.
When you’re done, you can try visiting your website.
If the critical error was caused by your WordPress theme, then it should be gone now and you should be able to access your site.
Reinstall WordPress
A corrupt WordPress core file or malware can also cause a critical error in WordPress. The easiest way to fix this is to reinstall WordPress.
Go to WordPress.org and download a fresh copy of WordPress on your PC. After downloading the file, you need to extract it from your computer. This will create a folder called “wordpress” which contains all the files needed for the reinstall.
You then need to connect to your WordPress site using an FTP client or the file manager app in your hosting control panel.
Once connected, you need to navigate to the root folder of your website. The root folder is the one that contains the wp-admin, wp-content, wp-includes, and wp-admin folders inside it.
Now select the files in the wordpress folder on your computer and upload them to your website. Your FTP client will ask if you want to overwrite or skip these files. You need to select “Overwrite” and check the box next to the “Always use this action” option.
Click on the “OK” button to continue. Your FTP client will now replace all your core WordPress files with fresh copies from your computer.
Once completed, you can try visiting your website to see if the error has been resolved.
If the critical value was caused by a corrupted WordPress core file or malware, then the error should be gone now.