What Is It and How to Use It to Fix Your Site

Chưa được phân loại

Did you just try to visit your WordPress site only to be met by a message saying “There has been a critical error on this website. Please check your site admin email inbox for instructions”? If so, your site is probably in WordPress recovery mode.

Recovery mode is a core WordPress feature that helps you fix fatal problems on your site. If your site is in this mode, two things will happen:

So – what do you do? How does recovery mode work and how can you get your site functioning again?

Well, that’s the topic of this post. We’re going to cover everything that you need to know about this topic, including the following:

The recovery mode message on the frontend of your site
How your site looks on the frontend

WordPress recovery mode is a core feature that was launched as part of WordPress 5.2, which was released in May 2019.

In a nutshell, it aims to make it easier for you to fix fatal errors on your site that would otherwise cause issues such as the WordPress white screen of death or the Parse/Syntax error.

Instead of just letting the fatal error happen, WordPress will automatically trigger recovery mode.

When your site is in recovery mode, you’ll still be able to access the backend WordPress dashboard via a special link, which gives you a chance to fix the problem.

Without recovery mode, your entire site would stop working in most fatal error situations (both the frontend and backend), which would mean you’d have to connect to your server via FTP to fix the issues.

That’s not fun! Trust us – recovery mode makes things much easier.

What issues trigger WordPress recovery mode?

The WordPress recovery mode triggers automatically – it’s not something that you’ll manually enable.

That might have you wondering what types of errors will trigger recovery mode.

In general, it will trigger (or at least try to trigger) whenever WordPress detects any code that will break your site.

This code could come from a faulty plugin or theme that you’ve installed. Or, if you’re trying to make custom code edits to your site (maybe via your child theme’s functions.php file), the problematic code could be from your own edits.

What does recovery mode do?

With recovery mode, WordPress will do a few things when it detects a fatal error on your site:

  1. It will try to automatically “pause” the code that’s causing problems so that you can still access your backend WordPress dashboard. For example, if the problematic code is in a certain plugin, WordPress will pause that plugin.
  2. You’ll get an email at the email address associated with your administrator account. You can use a special link in this email to open your dashboard in recovery mode.
  3. Instead of showing the underlying error on the frontend of your site, WordPress will just show a simple message that says “There has been a critical error on this website”.

Can you still manually fix your site?

While it is a really useful tool for fixing errors on your site, you certainly don’t need to use it. All of the normal WordPress troubleshooting tips will still work, so it’s totally possible to fix your site using those methods.

If you find that you can’t access recovery mode for some reason or you just don’t want to use it, you can follow the tips in our guide on how to fix the WordPress white screen of death to fix most/all of the issues that trigger recovery mode.

If you manually fix your site, it will go back to working even if you don’t launch recovery mode.

How to access WordPress recovery mode

If WordPress detects an error in your site’s code, it will automatically trigger recovery mode. However, you can’t access recovery mode just by going to your WordPress dashboard like you normally would.

Instead, you’ll need to use a special recovery mode link to access recovery mode. It looks something like this:

https://yoursite.com/wp-login.php?action=enter_recovery_mode&rm_token=KfHPAWSJ&rm_key=s0OG1KyTAdwk0

When WordPress triggers recovery mode, it should automatically send an email to the email address that you use for your Administrator account.

This email will include:

  1. Details on the specific error that’s occurring.
  2. A link that you can use to access recovery mode.
WordPress recovery mode email

The link is active for 24 hours from the time that the email was sent. After those 24 hours expire, WordPress will send another email with a new recovery link, which is also active for 24 hours. The cycle will keep repeating as long as your site is in recovery mode. That is, you’ll keep getting emails every 24 hours and each email will include a link that’s valid for 24 hours.

When you click the link in the email, you’ll be prompted to log into WordPress using the normal login form, with the addition of a new notice at the top:

WordPress recovery mode login email

In the next section, we’ll cover how to use WordPress recovery mode to fix your site. But first, let’s talk about a couple of other solutions for accessing WordPress recovery mode if you don’t receive the email.

Manually define recovery mode email

If you don’t have access to the email associated with your administrator account for some reason, you can also manually define the email that WordPress should send links to by editing your wp-config.php file.

You can edit this file by connecting to your server via FTP or using something like cPanel File Manager.

Add the following code snippet, making sure to replace the example email address with the actual email that you want to use:

define( 'RECOVERY_MODE_EMAIL', 'you@yoursite.com' );

Note that if your site is already in recovery mode, WordPress will not send an email to this address right away. You’d need to wait until the next email for the changes to take effect. Again, WordPress sends recovery emails every 24 hours, so manually updating the email like this probably isn’t a great solution if your site is already in recovery mode.

If you build client sites, this could also come in handy as it lets you make sure you receive the emails instead of your client (who might not know what to do with them).

WordPress recovery mode URL

If you don’t get the email that WordPress sends you for some reason, some people report that it’s possible to manually access recovery mode by entering the URL below.

However, this method did not work when I tested it. I’m including it because other people have suggested it as a solution, but your mileage may vary here.

If you want to try it, you can try entering this as the WordPress recovery mode URL:

https://yoursite.com/wp-login.php?action=enter_recovery_mode

Make sure to replace https://yoursite.com with the actual URL of your WordPress site.

How to fix the problem(s) that triggered the error

When you log into your site in recovery mode, you’ll see the normal WordPress dashboard, but with two additions:

  1. You’ll see a new Exit Recovery Mode option on the WordPress toolbar.
  2. You’ll see some admin notices that help you understand what’s going wrong.

For this example, the admin notice is telling me that something is wrong with one of my plugins – “One or more plugins failed to load properly”.

This makes sense because I intentionally broke some code in the Hello Dolly plugin!

What your dashboard looks like

If you’re still not sure what the problem is, the email that WordPress sent you also includes details on what’s going wrong.

For this specific problem, you would want to go to the Plugins area. If the problem is in your theme’s code, you would go to Appearance → Themes instead.

In the Plugins area, WordPress will mark the specific plugin that’s causing problems. It will also provide more information about the error. To fix a problem with the plugin, you have two options:

  1. Deactivate – you can deactivate the plugin to get your site working again. You could then replace it with a different plugin or reach out to the plugin’s developer for support to fix the problem.
  2. Resume – you can resume the plugin to make it live again. You should only do this if you’ve gone in and manually fixed the offending code snippet. If you resume the plugin without fixing anything, you’re just going to trigger the error again.
How to fix problems

For this example, I’ll just deactivate the plugin.

Once you’ve fixed the problem, you can click the button to Exit Recovery Mode and your site should start working again.

Get your WordPress site working again!

To recap, WordPress recovery mode is a useful core feature that helps you fix fatal errors like the WordPress white screen of death by automatically triggering recovery mode when it detects a problem with your site’s code, typically via an issue with a plugin or theme.

To fix your site, you can follow the special link in the email that WordPress sends you. This link will let you still access your WordPress dashboard and fix any problems without needing to resort to FTP or other more advanced troubleshooting tactics.

Once you’ve fixed the problem, you can exit the recovery mode and your site should start working again.

If you aren’t able to access the WordPress recovery mode for some reason, you can still fix your site – you just won’t be able to do it from the WordPress dashboard. For some troubleshooting tips that work without recovery mode, check out our guide on how to fix the WordPress white screen of death.

We also have general guides on WordPress troubleshooting and fixing common WordPress errors.

Do you still have any questions about how to fix your site? Let us know in the comments!

Free guide

5 Essential Tips to Speed Up
Your WordPress Site

Reduce your loading time by even 50-80%
just by following simple tips.

Bài viết liên quan

Trả lời

Email của bạn sẽ không được hiển thị công khai.