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?
Before 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 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 log in 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 into 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 with a link to fix it.
Once you click the provided link, youāre redirected to a new screen that 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. We deleted a semicolon in our themeās functions.php file 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 a 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 your site admin email inbox for instructions.
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.
Faulty Plugins
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 paid plans can get ruined sometimes. In this case, recovery mode is your friend.
Custom Code Gone Wrong
Even seasoned WordPress developers can make mistakes sometimes. WordPress is awesome in that you can customize it to suit your needs. There are ample opportunities to write custom scripts, create custom plugins, or simply use a bit of javascript to enhance a themeās capabilities. Sometimes, all it takes is a missing semicolon to send the whole thing tumbling down. With recovery mode, you donāt have to worry about building from the ground up when you make a mistake. The problem is usually identified, sometimes down to the exact line of code, allowing you to fix the problem and be back up and running in a jiffy.
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 thousands 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 several 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 a 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 for 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. Your theme could be outdated, have missing code, or have 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. 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 abandon dated plugins and/or upgrade your hosting provider.
You can also check your WordPress site health status using WordPressā built-in site health feature. To 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 three ways you can access recovery mode:
- Accessing the WordPress Recovery Email. This involves 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 the 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 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 to gain access to the site.
Open your siteās home page in your browser. Next, add this behind the URL.
/wp-login.php?action=entered_recovery_mode
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 of the link below. Be sure to replace /custom-login/ with your custom login URL suffix.
/custom-login/?action=entered_recovery_mode
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. The first is by clicking the red exit recovery mode button in the wp-admin panelās top bar. The 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 on 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
Great Blog! It was very informative. I have just started my blog here on WordPress and this will definitely help me in the future, so Iām just bookmarking it.
Thanks for detailed explanations. Glad to know that i can manage my site better with new knowledge i got from this contents.
I am facing the same issue , i am unable to login through my wordpress credentials, must be some error. Thanks for the post ill definitely use the recovery mode now to gain back access.
Great Blog! It was very informative. I have just started my blog here on WordPress and this will definitely help me in the future, so I’m just bookmarking it.
Wow! I didn’t seem to notice this feature before, you really helped me a lot and made it more convenient for me to create in the future
Informative article on wordpress recovery mode. Thanks!