blog

"There Has Been a Critical Error" in WordPress: How to Fix

A client's WordPress site shows "There has been a critical error on this website"? Find the recovery email, read debug.log and switch off the plugin.

7 min readFixesWordpressAgencies

A client sends a screenshot: their WordPress site is a white page with one line, "There has been a critical error on this website." No menu, no logo, often no dashboard either. Most of the time a plugin or theme update broke it, and once you know which one, the fix is usually quick.

This guide is for the person who looks after the site. It covers the exact messages WordPress shows, where the recovery email goes (and why you often never get it), how to find the broken plugin in debug.log, and how to switch it off without logging in. The quotes below are from WordPress's own code, in the files that show the error page and send the email.

What the message means

The short answer: PHP crashed with a fatal error while WordPress was building the page, so WordPress stopped and showed its error page with HTTP status 500. Since WordPress 5.2 this replaced the old blank "white screen of death".

What visitors see depends on where the crash happened. On normal pages, visitors get only this, with a link below it:

There has been a critical error on this website.

Learn more about troubleshooting WordPress.

On the dashboard or login page of a single site, the text is longer:

There has been a critical error on this website. Please check your site admin email inbox for instructions. If you continue to have problems, please try the support forums.

On a multisite network it asks visitors to "reach out to your site administrator". And once you're logged in through recovery mode, it says the site is "putting it in recovery mode" and points you to the Themes and Plugins screens.

The usual causes on client sites:

  • a plugin or theme updated itself overnight and is not compatible with something else;
  • the host upgraded PHP (for example to 8.x) and an old plugin uses code that no longer works;
  • someone edited functions.php or wp-config.php and left a typo;
  • PHP ran out of memory: the log says "Allowed memory size of ... bytes exhausted".

Step 1: find the recovery mode email

When a plugin or theme causes the crash, WordPress emails a recovery link. The subject is:

[Site Name] Your Site is Experiencing a Technical Issue

The email opens with "Howdy!", says "In this case, WordPress caught an error with one of your plugins" (or "your theme") followed by its name, and includes the error details: file, line and message. That tells you what to switch off.

Three rules decide whether it ever arrives:

  1. It goes to the site's admin email (Settings → General → Administration Email Address), unless RECOVERY_MODE_EMAIL is set in wp-config.php. On a client site that's often the client's own address or the developer who built the site years ago.
  2. It's only sent when the error happens on the dashboard or login page. A crash a visitor sees on the homepage does not send it. If the plugin also breaks the admin, opening https://clientsite.com/wp-login.php once will trigger it.
  3. It's sent at most once a day. By default the link is valid for 1 day, and a new one is sent if the error happens again after that.

There's no email at all when the crash isn't caused by a plugin or theme: a broken wp-config.php, a must-use plugin, or a problem in WordPress itself. Then go to step 3.

Step 2: use recovery mode

Click the link in the email and log in. WordPress pauses the plugin or theme that crashed, for your session only, so the dashboard works again. The Plugins screen gets a Paused tab that lists it.

Now fix it for everyone else, because visitors still see the error:

  • Deactivate the plugin, or switch to another theme.
  • Or update it, if the plugin's author has already shipped a fix.
  • Or roll back to the version that worked, from the host's backup or the plugin's previous release.

When you're done, click Exit Recovery Mode in the admin bar at the top. Then open the homepage, a normal page and, for a shop, the cart in a private window to check that the error is gone.

Step 3: no email, no dashboard? Read debug.log

If you can't get a recovery link, have WordPress write the error to a file. Open wp-config.php with SFTP or your host's file manager and add these lines above the line /* That's all, stop editing! Happy publishing. */ (older sites say "Happy blogging"):

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

This is the setup from the Debugging in WordPress handbook: errors go to wp-content/debug.log, and visitors don't see them on the page.

Load the broken page once, then open wp-content/debug.log and scroll to the bottom. Look for the line with PHP Fatal error. The file path in it names the culprit, for example:

PHP Fatal error:  Uncaught Error: Call to undefined function some_function() in /home/site/public_html/wp-content/plugins/old-gallery/gallery.php:112

Here the plugin is old-gallery. If the path is in wp-content/themes/, it's the theme.

Switch the plugin off without logging in. In wp-content/plugins, rename the folder, for example old-gallery to old-gallery-off. WordPress can't find it and deactivates it; the Plugins screen will say the plugin "has been deactivated due to an error: Plugin file does not exist." Not sure which plugin? Rename the whole plugins folder to plugins-off, check the site, rename it back and switch plugins on one at a time.

For a theme, rename the active theme's folder. WordPress falls back to a default theme such as Twenty Twenty-Five if one is installed.

When you're done, remove the debug lines again. The handbook says the debug tools are meant for local and staging sites, not live ones, and debug.log can grow large.

If the log shows an out-of-memory error or a PHP version problem, the fix is on the hosting side: raise the memory limit or switch PHP back in the host's panel, then update the plugin.

Why the client noticed first

Look at the rules again: the email only goes out after someone hits the dashboard, it goes to whatever address the client typed in at setup, and at most once a day. On a site nobody logs in to, the first person to see the error is usually a visitor, then the client, then you.

Two settings fix the "who hears first" part for every client site you look after:

  • Send recovery emails to your agency. Add define( 'RECOVERY_MODE_EMAIL', 'alerts@youragency.com' ); to wp-config.php.
  • Watch the site from outside. Because the error page is sent with status 500, any uptime check that requests the page sees it as down, whether or not anyone logs in.

In Pingbuddy, a status of 400 or above fails the check. A site counts as down after two failed checks in a row, and you get "🔴 Your site … is down." with the reason (a server error) in Telegram or email. Checks run every minute on Pro and Agency and every 5 minutes on Free. Pro and Agency alerts include a screenshot of what visitors see and a short AI explanation of the likely cause; Free includes 3 a month. See pricing for the plans, or try the free checkup on a client site first.

Two cases slip past a plain status check, on any tool:

  • A page cache keeps serving an old copy. The cached homepage can answer 200 while uncached pages, like cart, checkout or search, crash. Add one uncached page as its own site in your monitor.
  • The crash happens halfway down the page. Once part of the page has been sent with status 200, the status can't change, so the visitor sees half a page and the error. Pingbuddy's Page must contain setting (every plan) fails the check when a word from the footer, such as the company name, is missing from the HTML.

Pingbuddy also opens each page in a real browser to catch blank pages that still answer 200 OK, every 10 minutes on Pro and Agency (on Free, one site every 30 minutes). For the full routine of telling "our site" from "the host is down", see how to check if a website is down, and the live status of hosts such as WP Engine, Kinsta and SiteGround.

How to stop it happening again

  • Test plugin updates on staging first for sites with shops, memberships or custom code. Many managed WordPress hosts include a staging copy.
  • Turn off automatic updates for the plugins that broke before, and update those by hand on a weekday morning.
  • Ask before the host upgrades PHP. Many hosts announce PHP upgrades in advance; check that every plugin on the site supports the new version.
  • Keep a backup you can restore in minutes, and know where it is before you need it.
  • Watch every client site the same way: the uptime check, the footer text check, and the SSL and domain dates. A site with an expired domain fails differently, see domain expired and your site is down.

Renewals cause client outages too: paste all your client domains into the domain and SSL expiry checker to see which ones run out soon.

FAQ

What does "There has been a critical error on this website" mean?
PHP hit a fatal error while WordPress was building the page, so WordPress stopped and showed this message instead, with HTTP status 500. It's almost always a plugin, a theme, a PHP version change on the host, or a typo in wp-config.php or functions.php.
I never got the recovery mode email. Why?
WordPress only sends it when the error happens on the dashboard or the login page, only when a plugin or theme caused it, and at most once a day. It goes to the site's admin email, which on a client site is often the client or a former developer. Open /wp-login.php to trigger it, or read wp-content/debug.log instead.
How do I disable a plugin when I can't log in to WordPress?
Connect with SFTP or your host's file manager, open wp-content/plugins and rename the plugin's folder, for example woocommerce to woocommerce-off. WordPress can't find the plugin file and deactivates it. Rename it back later and activate it again once it's fixed.
Will an uptime monitor catch a WordPress critical error?
Usually, yes: the error page is sent with HTTP status 500, and a normal uptime check counts that as down. It can miss it when a page cache keeps serving an old copy, or when the error happens halfway through a page that was already sent with status 200. A "Page must contain" check covers the second case.

Run a free Pingbuddy checkup on any site: see whether it answers and how fast, when its SSL certificate and domain expire, and whether secret keys are visible in its public code.

Run free checkup →