"There has been a critical error on this website": how to fix it using recovery mode
TL;DR: The message "There has been a critical error on this website" means a fatal PHP error stopped WordPress from loading. It is almost always caused by a plugin, a theme, a recent update or a PHP version mismatch. WordPress emails the site administrator a recovery mode link that lets you log in and deactivate the broken plugin or theme. If the email never arrives, read the real error from the debug log or the host's error log, then disable the culprit by renaming its folder through FTP or the file manager. Always back up first.
What the message means
Since WordPress 5.2, a fatal PHP error no longer shows a blank white page. Instead, WordPress catches it and shows a generic message: "There has been a critical error on this website." The wording hides the details on purpose, so visitors do not see technical information.
The details are not lost. They are sent to the administrator by email, and they can also be written to a log. A critical error means a fatal error occurred, and the usual causes are:
- a plugin that was just installed, updated or is incompatible,
- a theme update or a bad edit to a theme file,
- a PHP version that is too new or too old for your code,
- a conflict between two plugins,
- a missing or corrupted file after a failed update,
- running out of PHP memory, and
- a syntax error from a code snippet pasted into
functions.php.
Think about what changed just before the error appeared. That change is the first suspect.
Fix 1: use the recovery mode email
WordPress sends an email to the site's administrator address with a subject like "Your site is experiencing a technical issue". It names the plugin or theme that triggered the error, when it can tell, and contains a special recovery link.
- Open the email, which goes to the address set in Settings, General, or the address configured for recovery.
- Click the recovery mode link. It logs you in to a limited session with the problem plugin or theme paused.
- Go to Plugins or Appearance. WordPress shows which extension has the error.
- Deactivate or delete it, or update it if a fix exists.
- Leave recovery mode from the admin bar, then check the site.
The recovery link is time-limited, and WordPress sends these emails only occasionally, so you may not receive a second one straight away. If you have not received it, check spam, and remember that this email can itself fail if your site cannot send mail. See WordPress not sending emails.
You can set a specific recovery address in wp-config.php if the admin email is wrong or unmonitored:
define( 'RECOVERY_MODE_EMAIL', '[email protected]' );
Fix 2: find the real error
If you do not get the email, or the email does not name a culprit, read the underlying error.
Option A: the debug log. Edit wp-config.php and add these lines above the "stop editing" comment:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Reload the page, then open wp-content/debug.log. The last "Fatal error" lines show the file path. A path containing /plugins/plugin-name/ or /themes/theme-name/ identifies the culprit. Turn debugging off again afterwards, because the log can reveal details and grow large.
Option B: the host's error log. In your hosting panel, open the PHP error log. It shows the same fatal error with a time stamp.
Typical messages and their meaning:
Allowed memory size exhaustedis a memory problem. See fixing the memory exhausted error.Call to undefined functionoften points to a missing PHP extension or a version mismatch.Parse error: syntax erroris a typing mistake in a code file.Cannot redeclare functionmeans two plugins define the same function.
Fix 3: disable the plugin or theme by folder
If you cannot log in, disable the culprit through the file system.
- Connect by FTP or open the file manager in your host's panel.
- Go to
wp-content/plugins/. - Rename the folder of the suspect plugin, for example
bad-plugintobad-plugin-off. WordPress then treats it as missing and deactivates it. - Reload the site. If it loads, you found the cause.
- If you do not know which plugin, rename the whole
pluginsfolder toplugins-off. The site should load without plugins. Rename it back, then rename the individual plugin folders one at a time to find the culprit. - For a theme, rename its folder under
wp-content/themes/. WordPress falls back to a default theme if one is installed.
Once the site works, update or replace the faulty plugin. Our guide to systematic plugin conflict debugging shows how to isolate conflicts, and auditing your plugins helps you clean up risky ones.
Fix 4: check the PHP version
A PHP upgrade is a very common trigger. Old plugins can fail on newer PHP, and new plugins can fail on old PHP. If the error started right after you or your host changed the PHP version:
- Switch PHP back to the previous version in your hosting panel.
- Confirm the site loads.
- Update the plugins and theme.
- Test on staging before moving to the newer PHP again.
With WordPress 7.0 setting a higher PHP floor, many sites are upgrading. Follow the safe order in our WordPress 7.0 requirements guide, and see which branches are supported in the PHP hosting checklist.
Fix 5: memory and other causes
- Memory. Raise the PHP memory limit if the log shows exhaustion. See PHP memory limit and execution time settings.
- Failed update. A plugin or core update that was interrupted can leave half-written files. Reinstall the plugin by replacing its folder with a fresh copy, or reinstall WordPress core files from a fresh download without touching
wp-contentorwp-config.php. - A leftover
.maintenancefile. If the site shows a maintenance message instead, see stuck in maintenance mode. - Corrupted file or permissions. Check file permissions and ownership match your host's recommendations.
- Database. If the error mentions the database, read the database connection error guide.
If you cannot get in at all
If nothing above works:
- Restore the latest backup. See how to back up and test a restore.
- Ask your host to restore from their snapshot or to read the error log for you.
- If you have no backup, copy the site files and database first, then work on the copy.
When you contact support, give the exact time the error began, what changed just before, and the fatal error line from the log if you have it.
How to avoid it next time
- Update on staging first, then copy to production. See staging vs production.
- Back up before every update.
- Update one thing at a time so you know the cause if something breaks.
- Do not paste code into
functions.phpwithout testing. Use a code-snippets plugin that catches syntax errors. - Keep the administrator email monitored so recovery messages reach a person.
- Remove plugins and themes you do not use.
- Match PHP to your plugins, and upgrade deliberately.
- Monitor uptime so you notice outages quickly, as described in uptime monitoring that alerts you.
How this differs from the white screen of death
The white screen of death is the older symptom of a fatal error: a completely blank page. The critical error message is its modern replacement, because WordPress now catches the failure and offers recovery mode. The causes and fixes overlap, and our white screen of death guide covers the blank-page variants, including cases where recovery mode does not trigger.
FAQs
What causes "There has been a critical error on this website"?
A fatal PHP error, most often from a plugin, a theme, a PHP version mismatch or a failed update.
I did not get the recovery mode email. What now?
Check spam, confirm the administrator address, and read the debug log instead. If you cannot log in, disable the plugin by renaming its folder.
Is my data lost?
No. The error stops the site from loading, but your content and database remain intact. Take a backup before making changes.
How long is the recovery link valid?
It is time-limited, so use it soon after receiving it. If it expires, trigger the error again or use the folder method.
Can I fix it without FTP?
Yes, if recovery mode works, you can do everything from the admin area. Otherwise use your host's file manager, which does not need separate FTP.
Will deactivating the plugin delete my settings?
Usually not. Deactivating or renaming the folder leaves its settings in the database, so they return when the plugin is reactivated.
Why did it happen after a PHP upgrade?
Code written for older PHP may use features that were removed. Revert PHP, update the plugin or theme, then retest on staging.
Should I leave debug mode on?
No. Turn it off after diagnosing, because logs can expose paths and details and may grow large.
Conclusion
A critical error is a fatal PHP error with the details hidden. Open the recovery email if you have it, otherwise read the log, find the plugin, theme or setting at fault and turn it off. Fix the underlying cause, and put staging and backups in place so the next update cannot take the live site down.
HostCloud's WordPress hosting includes tools and support to help you recover quickly. See the options at https://hostcloud.in.
Sources: