WordPress
There Has Been a Critical Error on This Website: The Fix, in Order
"There has been a critical error on this website" is WordPress telling you that some PHP code crashed hard enough to stop the page from loading. The fix is almost always one plugin, one theme, or one server setting, and you find it fastest with three tools used in a set order: the recovery mode email first, the debug log second, and WP-CLI (WordPress's command-line tool) third.
Most guides hand you all three at once, plus "rename your plugins folder" as step one. That works, but it's the sledgehammer. It turns off everything, hides which plugin was guilty, and can take your security plugin and checkout down with it. Going in order gets you the culprit's name before you touch anything.
If the site is down right now and you'd rather not open a single file, tell me what you're seeing in the maintenance questionnaire and I'll reply with a plan and a fixed quote within one business day. Otherwise, here's exactly what I'd do.
What "there has been a critical error on this website" actually means
Since WordPress 5.2, a fatal error (a PHP crash that stops the script, as opposed to a warning it can shrug off) no longer gives you a raw white screen. WordPress catches it, shows the polite "critical error" message, and emails the site admin a special login link. The core team called this fatal error recovery mode.
The message itself tells you nothing about the cause. In practice, the usual suspects are:
- A plugin or theme update that clashes with another plugin or with your PHP version.
- A PHP version change by your host. Old code that ran fine on PHP 7.4 can crash on PHP 8.x.
- An edit to functions.php (the theme file people paste snippets into) with one missing bracket.
- Memory running out. That one has its own fix, covered in my post on the WordPress memory limit and the host's hard cap.
- Files changed by someone who shouldn't be there. Less common, but I'll show you how to spot it below.
Here's the order I work in, and why.
Step 1: Use the recovery mode email (no server access needed)
The fastest fix needs nothing but an inbox. When the crash happens, WordPress sends an email with the subject "Your Site is Experiencing a Technical Issue". It names the plugin or theme that crashed and includes a recovery link.
Click the link, log in, and WordPress lets you into the dashboard with the broken plugin paused. Then:
- Go to Plugins and deactivate the plugin named in the email.
- Click Exit Recovery Mode in the top toolbar.
- Load your homepage in a private browser window to confirm it's back.
One detail most guides skip: the pause applies only to you. The same announcement says it plainly: for other users, "the site remains in a broken state until the issue has been fixed or mitigated." Your visitors still see the error until you deactivate the plugin. Pausing is not fixing.
When the recovery email never arrives
This is where most owners get stuck, usually for one of three reasons:
- The admin email is out of date. It goes to whatever is under Settings > General, which is often the address of the designer who built the site years ago.
- Your server can't send mail reliably, so the message bounces or lands in spam.
- It already went out. WordPress limits these emails to one per day by default, so a second crash the same afternoon may not trigger a fresh one.
You can fix the first problem before it ever matters. WordPress checks for a RECOVERY_MODE_EMAIL constant and uses it instead of the admin email when it holds a valid address. Add this to wp-config.php, above the "That's all, stop editing" line:
// Sends crash alerts to the person who will actually fix them.
// Safe: it only changes the recipient. Use an inbox someone reads.
define( 'RECOVERY_MODE_EMAIL', '[email protected]' );No email and no way into the dashboard? Move to step 2.
Step 2: Read the debug log to name the culprit
The debug log is a plain text file where WordPress writes every error it hits. The fatal error line tells you the exact file and line that crashed, which tells you the plugin or theme.
Turn it on in wp-config.php. WordPress's own docs say the log lands in wp-content/debug.log by default and that WP_DEBUG must be on for logging to work. They also warn against running debug tools on a live site for long, so this is a short visit, not a new setting:
// Logs errors to a private file instead of showing them to visitors.
// Could break: nothing, but turn it off when done. A public log leaks file paths.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', '/home/youraccount/logs/wp-debug.log' ); // outside public_html
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );I point the log outside the public folder on purpose. The default wp-content/debug.log can be downloaded by anyone who guesses the URL, and WordPress's wp-config documentation calls a publicly reachable error log a security risk.
Reload the broken page once, then read the last lines of the file in your host's file manager or over SSH:
# Shows the newest 30 lines of the log. Read-only, safe to run.
tail -n 30 /home/youraccount/logs/wp-debug.logA typical fatal error looks like this:
PHP Fatal error: Uncaught Error: Call to undefined function create_function()
in /home/youraccount/public_html/wp-content/plugins/old-slider/slider.php:212The folder after /plugins/ is your culprit. Here, it's an old slider plugin calling a PHP function that was removed in PHP 8. If the path says /themes/, it's the theme. If it points into wp-includes or wp-admin, that's WordPress core itself, and that changes the plan (more on that below).
Can't edit wp-config either? Many cPanel hosts also write an error_log file in the site's folder, and Plesk shows PHP errors under the domain's Logs. Same idea, different file.
Step 3: Use WP-CLI when you can't log in at all
WP-CLI lets you manage WordPress from the server's command line, with no dashboard needed. Most cPanel, Plesk and managed WordPress hosts include it if you have SSH (secure command-line) access.
The trick is two global flags. --skip-plugins and --skip-themes tell WP-CLI to load WordPress without the code that's crashing it. The WP-CLI handbook notes one catch: must-use plugins (plugins in wp-content/mu-plugins that WordPress always loads) still run.
# See which plugins are active, without loading any of them. Read-only.
wp plugin list --status=active --skip-plugins --skip-themes
# Turn off only the plugin named in the log. Could break: whatever that plugin did
# (a form, a slider) stops working until you replace or update it.
wp plugin deactivate old-slider --skip-plugins --skip-themesIf the theme is the problem, install and switch to a default theme the same way:
# Swaps to a stock theme so the site loads. Could break: your design, temporarily.
wp theme install twentytwentyfive --activate --skip-plugins --skip-themesNo SSH? Open the host's file manager or SFTP and rename the one folder from the log, for example wp-content/plugins/old-slider to old-slider.off. WordPress can't find it, so it stops loading it. Only rename the one folder, not the whole plugins directory, unless the log gave you nothing.
Deactivating every plugin with --all is the last resort, not the first move.
Why the order matters
Each step costs a little more than the one before it, and gives you a little more certainty.
| Step | Access you need | What it tells you | What it risks |
|---|---|---|---|
| Recovery email | An inbox | Which plugin or theme crashed | Nothing |
| Debug log | wp-config.php or host logs | The exact file and line | A public log, if left on |
| WP-CLI or rename | SSH or file manager | Lets you act without the dashboard | Turning off more than you meant to |
| Restore a backup | Host panel or backup tool | Nothing about the cause | Losing orders, form entries and edits made since the backup |
Restoring a backup feels safe, which is why people reach for it first. But a restore from Monday wipes out Tuesday's orders and contact form leads, and it doesn't tell you what broke. If the same plugin auto-updates again tonight, you're back where you started, only now with less data.
After the site is back: stop it happening again
Getting the site up is half the job. The other half:
- Roll the plugin back, don't just leave it off. If the latest version broke things and you need the feature, WP-CLI can install a specific older version with
wp plugin install old-slider --version=2.4.1 --force. Then report the bug to the developer. - Turn debug logging off. Set
WP_DEBUGback tofalseand delete the log file. - Check your PHP version. If the host just moved you to a newer PHP, ask whether a rollback is possible while you replace the old plugin.
- Test updates somewhere safe first. My update safety checklist covers the staging, backup and rollback routine I use before any update touches a live site.
If the critical error came right after you edited .htaccess and the page shows "500 Internal Server Error" instead, that's a different problem. My guide to the htaccess 500 error covers it.
When the error points into WordPress core
A crash in wp-includes or wp-admin usually means a failed core update or core files that were changed. Before you reinstall anything, compare the files with the official copies using wp core verify-checksums. If files you never touched show up as modified, treat it as a possible hack, not a bug. That's a job for a proper WordPress malware cleanup, not another restart.
Final Thoughts
The critical error message looks scary, but it's WordPress doing its job: catching a crash and telling you who to call. Read the email, read the log, then use WP-CLI. In that order, you usually find the guilty plugin before you've changed a thing. The real win is making sure the next update gets tested before your customers see it.
There has been a critical error on this website: FAQs
Why does WordPress say there has been a critical error on this website?
It means a PHP fatal error stopped your site from loading. Since WordPress 5.2, WordPress catches these crashes and shows a generic message instead of a blank page. The cause is usually a plugin or theme update, a PHP version change by your host, a broken code snippet in functions.php, or memory running out. The recovery email or the debug log tells you which one.
I didn't get the recovery mode email. What now?
Check the address under Settings > General and your spam folder first. WordPress also sends this email at most once a day by default, so a repeat crash may not trigger another. If the email is truly gone, enable the debug log in wp-config.php, reload the page, and read the fatal error line. It names the file that crashed. Then deactivate that plugin with WP-CLI or by renaming its folder.
Can I fix a WordPress critical error without admin access?
Yes. You need either SSH access for WP-CLI or a file manager or SFTP login from your host. With WP-CLI, run commands with --skip-plugins and --skip-themes so WordPress loads without the broken code, then deactivate the guilty plugin. Without SSH, rename that plugin's folder inside wp-content/plugins. WordPress stops loading it, and the site usually comes straight back.
Is a critical error a sign my site was hacked?
Usually not. Most critical errors come from updates and PHP version changes. It becomes suspicious when the debug log points into WordPress core folders you never edited, when you see unfamiliar files in uploads, or when the error appears with no update or change on your side. In those cases, run a checksum comparison of core files before assuming it's a bug.
Will I lose content fixing a critical error?
Not if you fix it by deactivating the guilty plugin or theme. Your posts, pages, orders and settings live in the database, and deactivating a plugin doesn't delete its data. You can lose recent content if you restore an older backup instead, because everything since that backup disappears. That's why I treat a restore as the last option, not the first.
Next step
If you'd rather have someone else watch for these crashes and test updates before they reach your live site, that's what my update-tested care plan does. Send me a few details through the maintenance questionnaire and I'll come back with a plan.
Want a second pair of eyes on your site?
Tell me what's going on in the wordpress maintenance questionnaire. I reply with a plan and a fixed quote within one business day.