There Has Been a Critical Error on This Website: The Fix
Get past the screen saying there has been a critical error on this website by reading the real PHP message in debug.log and disabling the plugin behind it.
That message means PHP hit a fatal error while building your page, and WordPress caught it before it turned into a blank white screen. The error is real and it is recorded. WordPress just won’t print it in the browser, because a stack trace on a public page shows file paths and code to anyone who visits.
So the fix is to read the actual error, then act on what it says.
What is actually happening
Since WordPress 5.2 core has a fatal error handler. WordPress registers it in wp-settings.php before any plugin or theme loads. When PHP stops on a fatal error, a syntax error included, the handler replaces the broken output with a short message and an HTTP 500 status. If it can tell which plugin or theme caused the crash, it can also email the administrator a link into recovery mode. Before 5.2 the same crash gave the white screen of death: no message, no email. A few crashes still do, such as a typo in wp-config.php, and that guide lists them.

The wording changes with where the crash happened. Every version ends with a “Learn more about troubleshooting WordPress.” link:
| What you see | When WordPress 7.1.4 shows it |
|---|---|
| ”There has been a critical error on this website.” | The front end, and multisite networks. This is what a visitor sees |
| ”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.” | wp-admin or the login screen, on a single site. It appears whether or not an email actually went out |
| ”There has been a critical error on this website, putting it in recovery mode. Please check the Themes and Plugins screens for more details. If you just installed or updated a theme or plugin, check the relevant page for that first.” | You are already in recovery mode and the crashing plugin or theme was paused |
The table is read from the WordPress 7.1.4 source. The first row is also what our test showed. Core also has a multisite wording (“Please reach out to your site administrator…”), but 7.1.4 only starts recovery mode on single sites, so a network normally shows the plain sentence.
Two files can change this page. A drop-in at wp-content/php-error.php replaces the message page with your own, and wp-content/fatal-error-handler.php replaces the handler itself. If a site shows a branded error page, look for those.
Step 1: get the recovery mode email
The email is the quickest way back in, but WordPress sends it in fewer cases than you might expect. This is how WordPress 7.1.4 decides (read from its source, not run):
| Situation | Email sent? |
|---|---|
The crash is in a plugin or theme and happens in wp-admin, on wp-login.php, or in certain admin AJAX actions | Yes, at most once a day |
The crash only happens on the front end, for example in a template or a template_redirect hook | No. Opening /wp-admin/ sends one only if the same crash also happens there, as it does for code that runs on every request |
| The crash is in a must-use plugin, a drop-in or a core file | No. Recovery mode can only pause regular plugins and themes |
| The site is a multisite network | No. Recovery mode is single-site only |
| An email already went out in the last 24 hours | No new email |
| The host cannot send mail | Not delivered, and the day’s one email still counts as sent, because WordPress records the time before it sends |
The email goes to the address in the RECOVERY_MODE_EMAIL constant if you’ve set one, otherwise to the administration email address in Settings → General. That is often not the address you log in with. Check that inbox, and check spam. The subject reads “[Your Site Name] Your Site is Experiencing a Technical Issue”, and the body includes the error details, the page that crashed and the link.
The link looks like wp-login.php?action=enter_recovery_mode&rm_token=…&rm_key=… and works for one day by default. Opening it puts your browser in recovery mode and shows the login screen with “Recovery Mode Initialized. Please log in to continue.” Once you log in, WordPress pauses the plugin or theme that crashed. In our test the Plugins screen showed “You are in recovery mode. This means there may be an error with a theme or plugin. To exit recovery mode, log out or use the Exit button.” with the test plugin marked as paused. Deactivate it from there.

If the email went to an inbox you never read, set the recipient in wp-config.php for next time:
define( 'RECOVERY_MODE_EMAIL', 'you@yourdomain.com' );
If no email comes, don’t wait for one. Go to step 2.
Step 2: read the real error
This is the step that turns a broken site into a short fix. In wp-config.php, change the existing WP_DEBUG line to true (adding a second one does nothing, because PHP keeps the first value), then add the other lines above the line that says to stop editing:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
WP_DEBUG_DISPLAY set to false keeps the error out of the browser while still writing it to disk, so visitors don’t see your paths while you debug. The WP_DEBUG code generator writes this block for you, and the WordPress debug mode guide explains each constant and how to switch them off again.
Reload the broken page once, then open wp-content/debug.log (or wherever WordPress writes debug.log on your host). The last entry starts with one long line like this, followed by a stack trace. This one comes from the test plugin behind the first screenshot on this page:
[01-Nov-2026 16:57:07 UTC] PHP Fatal error: Uncaught Error: Call to undefined function some_addon_missing_helper() in /wordpress/wp-content/plugins/some-addon/some-addon.php:6
The file path is the answer. On a live host it starts with your own document root (for example /home/user/public_html/) instead of /wordpress, which is where the test server keeps WordPress. If it points into wp-content/plugins/, that plugin is the cause. If it points into wp-content/themes/, it is the theme, for example something recently pasted into functions.php.
If debug.log does not appear, the folder may not be writable, or a security plugin may have moved logging elsewhere. Fall back to your host’s PHP error log. The label moves around between panels:
| Hosting panel | Where to look | What you get |
|---|---|---|
| cPanel | Metrics → Errors | Up to 300 of the most recent web server error log entries, newest first, no file access needed |
| Plesk | Websites & Domains → Logs | The web server’s logs for that one domain |
| Managed WordPress hosts | The site dashboard, usually a “Logs” tab, or SFTP/SSH into the account | Either a built-in log viewer or the raw log files |
In every panel you’re looking for the same thing debug.log would have shown: a line starting PHP Fatal error with a file path and line number.
Paste the entry into the WordPress error log decoder to translate the PHP wording and see which file to look at first.
Delete these debug lines when you are done. Leaving WP_DEBUG on in production fills the disk and, if WP_DEBUG_DISPLAY ever gets flipped back, prints server paths publicly.
Step 3: get back into wp-admin
If wp-admin is also down and no recovery email arrived, stop every plugin from the file system. Connect over SFTP (or your host’s file manager) and rename one folder:
mv wp-content/plugins wp-content/plugins-off
WordPress can’t find the plugins, so none of them load and admin access usually returns. The order of the next steps matters:
- Log in and open Plugins once while the folder is still renamed. That screen deactivates every plugin whose file is missing and says so for each one: “The plugin … has been deactivated due to an error: Plugin file does not exist.”
- Rename the folder back to
plugins. Everything now stays deactivated. If you rename it back before opening the Plugins screen, WordPress never recorded the change, and every plugin, the broken one included, loads again. - Reactivate plugins one at a time, loading the page that failed after each.
- The one that brings the error back is your culprit.
If the site is still broken with every plugin off, the theme is the suspect. Rename the active theme’s folder in wp-content/themes/. That stops the fatal and brings wp-admin back, but the front end only switches to a bundled default theme when you open Appearance → Themes (or the Customizer) once. Other admin screens don’t trigger the switch. The white screen guide explains why, and what happens if no default theme is installed.
The three causes worth knowing
A plugin or theme update that fatals. The log names the file directly. Roll that one plugin back to its previous version, or leave it deactivated and send the developer the log line. An image-handling plugin can also crash during a media upload in particular. Our WordPress HTTP error on image upload guide covers that narrower case.
A PHP version mismatch. Hosts retire old PHP versions on a schedule, sometimes without much warning. Code written for older PHP can stop working on a newer one. The tell is that nothing changed on your side and everything broke at once. Rolling PHP back one minor version in your hosting panel is a fair test, but treat it as buying time, not a fix. Old PHP versions stop receiving security patches.
Memory exhaustion. The log says “Allowed memory size of X bytes exhausted”. Raising the limit in wp-config.php is reasonable:
define( 'WP_MEMORY_LIMIT', '256M' );
That raises the ceiling. It does not fix whatever needed that much memory for one page, and the host’s own memory_limit can still cap it. Fixing the allowed memory size exhausted error covers both limits. If the number keeps needing to go up, something (often an import, a page builder or a heavy query) is the real problem.
Advice you can safely ignore
“Just increase the memory limit.” It only matters if the log says memory is exhausted. Otherwise it changes nothing and hides that you never read the error.
“Reinstall WordPress core.” Core files are rarely the cause, and replacing them takes time you could spend reading one log line.
“Turn off the fatal error handler.” The constant WP_DISABLE_FATAL_ERROR_HANDLER does that. You then get plain PHP behaviour: a blank page on most live hosts, or the raw error on your public site if display_errors is on. Neither tells you more than debug.log does. Use WP_DEBUG_LOG with WP_DEBUG_DISPLAY off instead.
“Clear your cache.” The fatal happens in PHP on the server. If a cached copy of the error page is being served, clearing helps after you fix the cause, never instead of it.
Still stuck?
If the log points at a core file rather than something in wp-content, the likely cause is a plugin that loaded earlier and broke something core relies on, not damaged core files. Turn everything off with the folder rename, confirm the site loads clean, then reintroduce plugins one by one. The last one you enable before the error returns is the one to report, with the log line attached. Only when the site still fails with every plugin and the theme ruled out is it worth replacing the core files with a fresh copy of the same version, or restoring a backup.
If the page shows Error establishing a database connection instead, PHP did not crash. WordPress could not reach its database and stopped before plugins loaded, so this handler had nothing to catch. That is WordPress’s error establishing a database connection, a different failure with a different fix.
And if the rest of wp-admin loads fine but only the post editor won’t (a spinning loader, a blank panel, “Updating failed”), that’s not a site-wide fatal at all. See the block editor not loading for that narrower problem.
Sources
- Make WordPress Core: Fatal Error Recovery Mode in 5.2
- WordPress Advanced Administration: Debugging in WordPress
- WordPress 7.1.4 source: class-wp-fatal-error-handler.php, class-wp-recovery-mode.php, class-wp-recovery-mode-email-service.php, wp-admin/includes/plugin.php (validate_active_plugins)
- PHP manual: Runtime configuration for errors (log_errors, display_errors)
- cPanel & WHM Documentation: Errors
William Lopez is the founder of Odie Themes. He builds the free WordPress tools and themes on this site and has been on WordPress.org since December 2019.
FAQ
Questions
What does there has been a critical error on this website mean?
It means PHP hit a fatal error while building the page and WordPress caught it before the blank white screen appeared. The message is deliberately vague so visitors do not see file paths or code. The real error, with the file and line number, is written to a log on the server.
Where is the WordPress critical error log?
If you set WP_DEBUG and WP_DEBUG_LOG to true in wp-config.php, WordPress writes to wp-content/debug.log. If those are off, PHP can still write the error to the host's own error log, if the host has PHP error logging switched on (the php.ini-production file PHP ships turns it on). Look under logs or error logs in the hosting control panel. Check both before assuming nothing was recorded.
Why did I not get the WordPress recovery mode email?
WordPress sends it only when the crash comes from a plugin or theme and happens in wp-admin or on the login screen. A crash seen only on the front end sends nothing, and so does one in a must-use plugin or in core. It goes to the RECOVERY_MODE_EMAIL address if you set one, otherwise to the admin email in Settings > General, and at most once a day. Hosts that cannot send mail never deliver it. Check spam, then use SFTP instead.
How do I fix a critical error if I cannot log in to wp-admin?
Connect over SFTP or your host's file manager and rename the wp-content/plugins folder to plugins-off. That stops every plugin at once and usually brings wp-admin back. Open the Plugins screen once so WordPress records them as deactivated, rename the folder back, then reactivate plugins one at a time until the error returns.
Can a PHP version upgrade cause a critical error in WordPress?
Yes. When a host moves a site to a newer PHP version, older plugin or theme code that uses removed functions or syntax can fatal straight away. The log entry usually names a specific file in wp-content. Rolling PHP back in your hosting panel confirms the diagnosis, but it is a temporary fix.
Does the critical error message mean my site was hacked?
Not by itself. The message only says PHP hit a fatal error, and a plugin or theme that does not work with your PHP version, or a page that runs out of memory, shows exactly the same screen. Malware can cause fatal errors too, but then the log entry points at an unfamiliar file or obfuscated code. Read the log before assuming a compromise.