WordPress Fix: There has been a critical error on this website.
There has been a critical error on this website. If that's what greeted you, start here: your posts, pages and orders are still in the database, untouched. Since WordPress 5.2, this message is what visitors see instead of a blank white page when PHP hits a fatal error it can't recover from. In wp-admin, WordPress adds a line telling you to check your site admin email inbox. This guide walks through that email, how to read the real error behind the message, how to isolate the cause when you can't even log in, and how to stop it from happening again.
What this message actually means
A fatal error means PHP hit code it could not continue running and stopped. Before WordPress 5.2, that produced a blank white screen with no explanation — the "White Screen of Death." WordPress 5.2 added fatal error protection: it catches the crash and shows this message instead, so at least visitors see something other than a blank page.
Almost always, the broken code belongs to a plugin, the active theme, or custom code you or someone else added — a snippet in functions.php, or a must-use plugin in wp-content/mu-plugins. WordPress core itself is rarely the cause.
The database isn't affected. Your posts, pages, products and orders are exactly where they were; the error is in the code that tries to display or process them, not in the content itself.
Step 1: check your admin email
When the error happens, WordPress emails the site's admin address — the one under Settings → General, or the address set in the RECOVERY_MODE_EMAIL constant if your site defines one. The subject line reads "Your Site is Experiencing a Technical Issue." The email usually names the plugin or theme at fault, along with the file and line number, and includes a one-click recovery mode link.
Recovery mode logs you into wp-admin with the faulty plugin or theme paused — only for your session, so other visitors still see the error. From there you can deactivate it, roll it back, or update it, then exit recovery mode from the admin bar once you're done.
The link expires after a limited time, and WordPress rate-limits these emails, so a second one may not arrive right away if you miss the first.
If no email arrives, check spam first. If it's genuinely not there — because the site can't send mail at all — move on to step 2.
Step 2: read the real error
Add these three lines to wp-config.php, above the "That's all, stop editing!" comment: `define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false);`. Load the page that failed once, then open wp-content/debug.log.
Look for the line starting "PHP Fatal error". It names the file path where PHP stopped. The folder in that path — wp-content/plugins/<name> or wp-content/themes/<name> — is your plugin or theme to blame.
Security note: debug.log sits inside wp-content, and anyone who guesses or finds its URL can download it, sometimes with paths or data you'd rather not expose. Turn WP_DEBUG_LOG back off and delete the file once you've read it, or point it at a path outside the web root. Relvato's exposure scan monitor flags a debug.log left public, in case you forget.
No access to wp-config.php, or don't want to touch it? Most hosting control panels have their own PHP error log that shows the same fatal error line, with nothing to edit and nothing to clean up afterward.
Step 3: isolate it when you can't reach wp-admin
Over SFTP or your host's file manager, rename the wp-content/plugins folder to something like plugins-off. If the site comes back, rename it back to plugins and reactivate your plugins one at a time until the error returns — that last one is the cause. To skip straight to a hunch, rename only that one plugin's folder.
For the theme: rename the active theme's folder. WordPress falls back to a default theme — Twenty Twenty-Five or whichever you have installed — and the site should load again.
With WP-CLI, the same moves are one command each: `wp plugin deactivate --all --skip-plugins --skip-themes` and `wp theme activate twentytwentyfive` (or another default theme you have installed).
Caveat: must-use plugins in wp-content/mu-plugins, and drop-ins such as object-cache.php, advanced-cache.php or db.php in wp-content, keep running even after you rename the plugins folder. If the error survives every plugin and theme test, check those next.
Fix it, then get back online
Roll back to the last version that worked, or restore a backup from before the error started — see rolling back a plugin update for the exact steps. If a backup is your only option, that's what it's for.
Report the log line to the plugin or theme author; a specific file and line number is most of the fix for them. Once a safe version exists, test it on a staging copy before it reaches the live site — the kind of routine covered in WordPress maintenance.
This error follows a change far more often than it follows nothing — see why websites break for the pattern behind it. If updates landing without warning bothers you more than this one error did, disable WordPress auto-updates and apply them on your own schedule instead.
Don't just hide the message. WP_DISABLE_FATAL_ERROR_HANDLER turns fatal error protection off entirely, which brings back the blank white screen — it removes the message, not the error.
Know about it before your visitors do
Relvato's PHP errors & unsent emails monitor records PHP fatal errors inside WordPress through the free Relvato WordPress plugin, and names the plugin or theme responsible. That includes fatals inside cron, REST and AJAX requests, which never show this message to anyone because no visitor loads that page.
When the whole site is down, WordPress itself can't run to show this message at all — the page just fails to load. Relvato's Uptime monitor catches that from outside, the way a visitor would hit it, and emails you.
On paid plans, Relvato re-runs your monitors right after every plugin, theme or WordPress core update — which is exactly when this error tends to show up. On the Free plan, monitors run weekly or whenever you start them by hand, with an email on each new failure.
Common causes, what the log shows, and what to do
| Cause | What the log shows | What to do |
|---|---|---|
| A plugin or theme update, or two plugins that clash | The fatal error points at the plugin or theme you just updated | Roll back that update, or update the plugin it clashes with |
| Your host changed the PHP version | "Call to undefined function" or "Uncaught Error" naming an old function | Update or replace the plugin, or switch PHP back temporarily in the hosting panel |
| The memory limit was reached | "Allowed memory size of … bytes exhausted" | Raise WP_MEMORY_LIMIT or the host's limit, and find what's using so much memory |
| Execution time ran out | "Maximum execution time of 30 seconds exceeded", every page hanging about 30 seconds first | Find what the code is waiting on — an external API, a slow or unreachable database, a loop that never ends |
| An update was interrupted partway | Errors naming WordPress core files that look incomplete or missing | Re-upload WordPress core files (skip wp-content and wp-config.php), or reinstall the plugin |
| Custom code in functions.php or a must-use plugin | "Syntax error" or "Cannot redeclare" naming your own file | Undo the last edit to that file |
Questions, answered
Does this mean my site has been hacked?
Usually not — it's almost always a plugin, theme or custom-code bug, not an attack. Treat it as a possible hack only if you changed nothing yourself and the error log points to a file you don't recognize and didn't install.
Is my content lost?
No. The error happens in code that runs on top of your content, not in the database itself. Your posts, pages, products and orders are still there once the underlying code is fixed.
What if the recovery mode link expired, or no email ever arrived?
The link is time-limited and WordPress rate-limits these emails, so there isn't always a fresh one waiting. Skip straight to reading the real error in step 2, or isolating the cause by file manager or WP-CLI in step 3.
The error only shows in wp-admin, or only on one page — what then?
The same debug.log reading in step 2 still applies: the fatal error line names the exact file involved, whether it's loading on every page or only one admin screen or template.
Can I change or hide the message itself?
A php-error.php drop-in in wp-content can customize how the message looks, and WP_DISABLE_FATAL_ERROR_HANDLER removes it entirely in favor of the old blank screen. Neither one fixes the underlying error — they only change what visitors see while it's still broken.