WordPressリカバリーモード。リカバリーモードとは何か、そしてそれを使ってあなたのサイトを修復する方法

この記事には、アフィリエイト広告を利用しています。

スポンサーリンク

WordPressのサイトにアクセスしようとしたら、「このWebサイトでは重大なエラーが発生しました」というメッセージが表示されたことはありませんか?サイト管理者のメール受信箱を確認して指示を仰いでください」というメッセージが表示されましたか?もしそうなら、あなたのサイトはWordPressのリカバリーモードになっている可能性があります

リカバリーモードは、サイトの致命的な問題を解決するための、WordPressの中核的な機能です。

このモードになっている場合、次の 2 つのことが起こります。

  • サイトのフロントエンドに上記のエラーメッセージが表示されます。
  • 件名が「[サイト名] Your Site is Experiencing a Technical Issue」であるメールを受信する必要があります。

それで – あなたは何をするのですか?リカバリーモードはどのように機能し、どのようにサイトを再び機能させることができるのでしょうか?

それがこの記事の主題です。

このトピックでは、以下を含む、このトピックについて知っておく必要があることすべてを取り上げるつもりです

  • WordPress のリカバリーモードとは何か、そしてそれがどのように役立つのか。
  • WordPressリカバリーモードにアクセスする方法。
  • 問題を修正し、サイトを再び動作させる方法。

始める準備はできましたか?あなたのサイトを修復しましょう

スポンサーリンク

WordPressのリカバリーモードとは?

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 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!

タイトルとURLをコピーしました