If you are a regular WordPress user, you’ve most likely encountered errors from time to time. The critical error, technical difficulties, or the dreaded WordPress white screen of death can ruin your day and take your site offline, leaving unsuspecting visitors wondering what happened. Not only does this cost you valuable clicks, but it could make visitors never return to your site. Thanks to WordPress recovery mode, those problems are short-lived and a lot easier to fix.
What is WordPress Recovery Mode?
Prior to the release of WordPress 5.2, you’d typically see the WordPress white screen of death. Since WordPress recovery mode was introduced in May 2019, users generally see an error message on their site when something bad has happened. When a problem is detected, WordPress sends an email to the administrator containing a login link and details about the error.
You might be wondering what causes these messages. Most of the time it’s due to broken code or a plugin update gone horribly wrong. Other possible causes are plugin conflicts, a problem with your theme, or custom code that you may have implemented. Whatever the cause, WordPress does a pretty good job of identifying when there is an issue, and letting you know about it.
What Happens When WordPress Enters Recovery Mode?
When an error occurs, WordPress will try to identify the problem and isolate it. As mentioned previously, an email is generated and sent to the site administrator. Next, WordPress will disable the faulty code so you can login to your site to correct the problem. Be mindful that recovery mode doesn’t fix your site for you. It only allows you access to the site so you can correct it. The rest of the world will see the error message, so it’s crucial to fix the problem as soon as possible.
What Can You Do in Recovery Mode?
The best thing about recovery mode is having the ability to troubleshoot errors without the need for FTP. This is very useful when dealing with plugin or theme problems, as well as fixing a broken line of code or two. When you log in to recovery mode, you’ll likely get insight to your issue right in the WordPress dashboard. Recovery mode is indicated by a large red button in the top right corner of the admin bar.
You Can Fix a Faulty Plugin
In this example, you’ll see that the error stems from a plugin not loading properly. The dashboard shows an error message describing the problem, and provides you a link to fix it.
Once you click the provided link, you’re redirected to a new screen which reveals the problem plugin, along with lines of code detailing the specific issues that were encountered. With this example, you have two choices. Deactivate the plugin, or resume using it. Obviously the safe choice is to deactivate the plugin. You’ll then troubleshoot what happened, and take steps to fix it.
Troubleshoot Theme Issues
This example gives us a critical error with more specific details as to what caused the error. Basically, we deleted a semicolon in our theme’s functions.php file in order to trigger recovery mode.
WordPress did its thing and generated an email letting us know that there was a problem. As the screenshot shows, there’s a link provided to us to log in to correct the issue. Additionally, WordPress lets us know exactly what the error is.
Once we log in, we see that there was an issue with our theme. WordPress prompts us to click through to the themes screen.
At this point, we know what the problem is (because we caused it), and correct it. However, if you find yourself in a similar situation, your next course of action should be to disable your theme, check your functions.php file for errors, and enable a default theme while you hunt down the code causing issues.
Does Safe Mode Do the Same Thing as Recovery Mode?
In short, no. Safe mode is generally used by themes such as Divi to disable plugins, custom scripts, and child themes. Additionally, some plugins such as WP Safe Mode offer the same functionality. The difference between recovery mode and safe mode is simple. With recovery mode, the specific plugin or theme causing the issue is disabled rather than all themes and plugins.
Why Would You Need WordPress Recovery Mode?
There are a couple of reasons that WordPress Recovery Mode will come in handy. First, it allows you to identify site errors by displaying different types of error messages on your site. Whether it’s the critical error message, technical difficulties, or simply a PHP error, recovery mode can prove to be useful in solving them. Another possible reason would be that your theme or one of your plugins isn’t supported on your current version of PHP.
Common Errors Displayed in WordPress Recovery Mode
Most of the time WordPress will alert you to an issue by giving you an error message. There are various types of messages you may see, so we’ll help you identify them and what might be the cause for each one.
1. The Critical Error Message
The Critical Error Message in WordPress Recovery Mode usually consists of the following message:
There has been a critical error on your website. Please check you site admin email inbox for instruction.
Critical Error Message Common Causes
There can be many reasons you have this error message. Most of the time, it can be narrowed down to just a few. Let’s explore the most common causes.
The large number of plugins available for use in WordPress is one of its best features. That being said, it can be a double-edged sword. It’s generally best to do your research when looking to install and use a new plugin for your site. Some are outdated, no longer supported, or incompatible with the most recent version of WordPress, and should be avoided. However, even the best laid plans can get ruined sometimes. In this case, recovery mode is your friend.
Custom Code Gone Wrong
Broken or Outdated Theme
Themes are great for making your WordPress stand out from the crowd. Themes like Divi allow you to customize your site extensively, allowing for endless design options. There are 1000’s of themes on the market. Sometimes when themes are updated, wires get crossed, and your theme could break. Additionally, there are situations when you install a theme and forget to update it. If WordPress releases an updated version that isn’t compatible with your theme, you could get the technical difficulties error message.
2. Technical Difficulties Error Message
Another reason that you might require recovery mode is when you have the dreaded technical difficulties error message. The Technical Difficulties Error Message in WordPress Recovery Mode usually consists of the following simple, yet quite unnerving, message:
The site is experiencing technical difficulties.
Technical Difficulties Error Message Common Causes
While there could be a number of reasons why you’re seeing this, the most common problem is a theme or plugin conflict. Other possible causes could be that your site was injected with malware.
Theme Conflict With a Plugin
Sometimes during plugin updates, there could be a conflict with your theme. Reputable theme creators generally do a good job of keeping their framework up to date. However, there are situations when theme updates aren’t enough. As previously mentioned, it’s wise to choose a plugin that has a good reputation with regular updates. Choosing a plugin that hasn’t been tested with your current version of WordPress could cause your site to develop errors.
Plugin Conflict With Another Plugin
Similarly to theme conflicts, plugins can also become incompatible with other plugins. Do your research before installing new plugins. Check support channels as well as the WordPress.org forum page for that specific plugin to learn about potential issues before downloading. When considering a new plugin, there are other options to the WordPress repository you should consider. If you are a Divi user, Divi marketplace is great place to look for adding new functionality to your website. Additionally, other premium plugin offerings are good options to consider when you need new features to your site.
Your Site Has Been Hacked
Having your website hacked is probably one of the scariest situations a site owner or developer can have. You could be locked out of your website, your site could be redirected, or it could be used by bad actors for nefarious purposes. When your site is hacked, scripts could be running that will throw errors, alerting WordPress to their presence. That’s when recovery mode would kick in.
3. PHP Code Errors
Sometimes you won’t see a critical or technical difficulties error message. There could simply be a few lines of PHP on your screen. In that case, it’s usually caused by a problem with your theme. You theme could be outdated, have missing code, or custom code you implemented causing a conflict.
4. Your Version of PHP is Causing Issues
Another thing to evaluate is the version of php running on your site. Sometimes the problem is easily corrected by switching to a different version. For instance, if your theme is outdated with no new version available, rolling back php to an older version may solve the issue. However, WordPress doesn’t recommend rolling back farther than 7.4. Doing so leaves your site vulnerable to security issues and slower performance. In fact, our Divi Theme currently supports PHP version 8.0+ and recommends at least PHP version 7.4 as a hosting requirement for these reasons. That said, solving the issue may not be easy and may require you to abandone dated plugins and/or upgrade your hosting provider.
You can also check your WordPress site health status using WordPress’ built-in site health feature. The check on the site health for WordPress, navigate to Tools > Site Health from the dashboard. this should show you whether or not you are using an outdated version of PHP, among other critical issues and recommendations.
How to Enter WordPress Recovery Mode
There are basically three ways you can access recovery mode:
- Accessing the WordPress Recovery Email. This invloves clicking the link provided in the WordPress recovery mode email.
- Accessing WordPress Recovery Mode Manually via wp-config.php. This involves adding a line of PHP code to your wp-config.php file via FTP, if you don’t have access to your administrator email.
- Adding Recovery URL Manually. This involves manually recreating the recovery mode URL.
Let’s explore these methods in more detail.
Accessing the WordPress Recovery Email
The first step to ensure recovery emails is to be sure your administrator email address is correct in WordPress. You’ll want to do this before you have an issue, because you may not have access to your wp-admin dashboard. Having an incorrect admin email will prevent you from being able to utilize recovery mode the easy way.
To check this, log in to your WordPress site and navigate to settings. Next, click on general. Look for WordPress administration email address. If your email address is correct, you should be able to receive recovery emails in the event of a problem.
When an error occurs, WordPress will send you an email address alerting you to a problem on your site. The link contained in the email will bring you to the recovery login screen. Once logged in, details about your error will be visible to you — enabling you to correct the problem.
How To Access WordPress Recovery Mode Manually
WordPress recovery mode is a great feature, but what if you don’t have access to the admin email and need to change it? There are times when you won’t have access to the back end of your site to change your email, so you’ll need to try different ways to enable recovery mode.
Edit Your Wp-config.php File
For this example, you’ll use an FTP program such as FileZilla in order to edit your wp-config.php file. You’ll need to define an email address so that WordPress will know where to send your alert messages. We’ll use FileZilla to show you how to edit the file.
First, open FileZilla and establish a connection to your server. You can find and generate SFTP credentials through most WordPress hosting providers. Once you have the information needed to establish a connection, click on site manager.
When the dialog box appears, either click a current site, or add a new one by clicking on new site. Choose SFTP from the drop down menu, then enter your host and port. Next, choose normal from the logon type menu, fill in your user and password information, then click connect.
Navigate to the wp-config file by selecting the root /public-html/ folder. Select the wp-config.php file, then click view/edit.
Next, add the following line of code to the file. Be sure to change [email protected] to your email address.
define( 'RECOVERY_MODE_EMAIL', '[email protected]' );
Finally, click save. Adding the code tells WordPress to send the recovery email to the administrator email address specified in your WordPress settings. Keep in mind that if the system has already generated an email on that day, you’ll need to wait 24 hours before receiving another one. This won’t always work for you, so let’s explore another way.
Add Recovery URL Manually
If you can’t wait 24 hours for WordPress to send out the recovery email, there is another method to try. You can manually generate a recovery link in order to gain access to the site.
Open your site’s home page in your browser. Next, add this behind the URL.
We’d like to mention that this worked on most of the sites we attempted this fix on. That being said, if you use a plugin or another method to mask your wp-admin login URL, you’ll need to use a variation the link below. Be sure to replace /custom-login/ with your custom login URL suffix.
When you manually recreate the recovery URL, you may not get those handy errors telling you where the problem lies. In that case, you’ll want to put your troubleshooting cap on and get to work.
How to Exit Recovery Mode
Exiting recovery mode is quite easy. WordPress provides a couple of links for you to exit. First is by clicking the red exit recovery mode button in the wp-admin panel’s top bar. Second, is by clicking the link next to the error message in the dashboard.
It’s important to note that you should be sure you’ve corrected any issues before exiting recovery mode. If you do so without fixing the problem, your site will continue to display error messages, making your site inaccessible to visitors.
What if You Can’t Exit Recovery Mode?
In rare cases, you may find yourself unable to exit recovery mode even after you’ve solved the problem. In those situations, you’ll want to enable debugging to try and identify what the issue is. There are several ways to approach this.
First, you can edit your wp-config.php file. To do this, open your wp-config.php file through FTP. The first line should already be present. You’ll simply want to change false to true. The second line will need to be added. This basically tells WordPress to make the debug log viewable. This method is valuable if you still don’t have access to the back end of your site.
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true );
The second way is best utilized when you do have access to the back end. There are several debugging plugins available on the WordPress repository. One we recommend is Health Check and Troubleshooting. It’ll give you a good idea of what’s going on in your site, and can assist you in solving problems.
The last option is to use debug mode in your hosting provider. Providers such as Flywheel provide a simple way to enable debugging on your site using debug mode in the Flywheel dashboard.
What if Recovery Mode Didn’t Solve Your Problem?
WordPress recovery mode is a great feature to help you identify and correct problems on your website. Most of the time, the issue can easily be traced back to a plugin, theme conflict, or errors in custom code. However, there could be situations where additional troubleshooting is required. If our previously mentioned methods aren’t working for you, try troubleshooting your way through some common WordPress errors to bring your website back from the brink of death.
Have you experienced issues with WordPress in the past? What did you do to correct the problem? Leave us a comment below.
Featured Image Kniazeff / shutterstock.com