There has been a critical error on this website: using recovery mode
Behind the polite message is an ordinary PHP fatal error, and WordPress has a built-in way to get you back into the dashboard around it. Here is how recovery mode works, why the email so often never arrives, and how to get in without it.
A plugin updates overnight, and in the morning the whole site shows one sentence: There has been a critical
error on this website. The dashboard shows it too. Underneath is an ordinary PHP fatal error, and WordPress
has a built-in way to get you back in around it.
What does "there has been a critical error" mean?
It means PHP hit a fatal error while loading the page, and WordPress caught it. Since version 5.2, WordPress registers its own fatal error handler. Instead of the blank white screen older versions showed, it prints a short message and, in the right circumstances, starts recovery mode. The cause is almost always a plugin or theme, most often one that was just installed or updated.
The exact wording matters, because WordPress varies it:
- "There has been a critical error on this website." on its own means this request did not trigger a recovery email. That is normal for a front-end page.
- "...Please check your site admin email inbox for instructions." means the error happened in the admin area or on the login page, and WordPress tried to send the recovery email.
- "...putting it in recovery mode." means you are already in recovery mode.
Older sites may still show The site is experiencing technical difficulties., which was the wording
in WordPress 5.2. Same mechanism, same next steps.
How does WordPress recovery mode work?
Recovery mode starts when the fatal error happens on a protected page, which in practice means the admin area or
the login page. WordPress then emails a recovery link to the site's admin address, the one in Settings, General,
or to the address in a RECOVERY_MODE_EMAIL constant in wp-config.php if you set one. The
email names the plugin or theme that failed and includes the error details.
The link logs you in with that extension paused, so the dashboard loads again. WordPress rate limits the email to
one per day, and the link expires after one day as well. If you got the front-end version of the message and no
email, visit /wp-admin/ once: if the same fatal happens there, that request is the one that sends the
email.
Why did the recovery email never arrive?
This is the common case rather than the exception, and there are four usual reasons:
- The admin address is stale. It still points at a developer who left, or a mailbox nobody reads.
- The site cannot send mail reliably. Many hosts let WordPress send through PHP's built-in mail function, which spam filters treat harshly. Check the spam folder first.
- The rate limit already fired. One email per day means the first one, sent at 3am, may have been the only one. A second visit to the dashboard explains that a link was already sent.
- The fatal never happens on a protected page. If the broken code only runs on the front end, the dashboard loads normally and recovery mode never starts. In that case you can simply log in and deactivate the plugin.
How do you get back in without the email?
Disable the broken extension from outside WordPress. If the error message or your hosting log names the plugin,
open wp-content/plugins over SFTP or your host's file manager and rename that plugin's folder, for
example woo-extras to woo-extras.off. WordPress cannot find the plugin any more and
deactivates it on the next page load. For a theme, rename the theme folder and WordPress falls back to a default
theme if one is installed.
With shell access, WP-CLI does the same job more cleanly. The fatal would normally break WP-CLI too, so tell it to skip loading plugins and themes while it works:
wp plugin list --skip-plugins --skip-themes
wp plugin deactivate woo-extras --skip-plugins --skip-themes
If nothing names the culprit, read the actual PHP error. Switch on WordPress's debug log with display off, load
the page once, and read wp-content/debug.log. The exact settings are in
the 500 error guide. The last fatal in the log
names the file, and the file path names the plugin.
What should you do once you are back in?
Fix the cause, then leave recovery mode. If an update broke the plugin, check whether a newer version has already fixed it, or roll back to the previous version. If the plugin is abandoned, replace it. Then use the Exit Recovery Mode button in the admin bar and load the front end in a private window to confirm visitors see the real site again.
Two habits make the next one smaller. Point the admin email, or RECOVERY_MODE_EMAIL, at an inbox
someone reads, and send WordPress mail through a proper SMTP service so the email actually lands. And when the
fatal came from a PHP version change rather than a plugin update,
call to undefined function after an upgrade
covers that case.
How the WordPress plugin fits in is on the WordPress page. If the site is down for a reason that is not PHP at all, start with the first five minutes.
Found something wrong in here? Tell me.