“There has been a critical error on this website. Please check your site admin email inbox for instructions.” This is WordPress’s friendly cover for a PHP fatal error. Since version 5.2, WordPress catches fatal errors and shows this message instead of a blank white screen. The cause is almost always a plugin, a theme, or a PHP version or memory problem, and it’s usually fixable in minutes.
Step 1: check the recovery mode email
WordPress emails the site admin address with:
- which plugin or theme caused the error;
- a recovery mode link that lets you log in with that extension paused.
Click it, log in, and deactivate or update the culprit. If the email didn’t arrive (often because the server can’t send mail), continue with the steps below. See WordPress SMTP.
Step 2: find the actual error
Server error log (works even if WordPress can’t load):
sudo tail -n 30 /var/log/nginx/error.log | grep -i "PHP"
# or the PHP-FPM log
sudo journalctl -u php8.3-fpm --since "30 min ago" | tail -n 30
WordPress debug log: add to wp-config.php:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Reload the page, then:
tail -n 30 /var/www/example.com/wp-content/debug.log
The message tells you the file and line, for example:
PHP Fatal error: Uncaught Error: Call to undefined function some_function()
in /var/www/example.com/wp-content/plugins/some-plugin/includes/class-x.php:42
The path (plugins/some-plugin) tells you the culprit. See WordPress debug mode.
Step 3: disable the culprit
With WP-CLI:
cd /var/www/example.com
wp --skip-plugins --skip-themes plugin deactivate some-plugin
# not sure which? deactivate all, then re-enable one by one
wp --skip-plugins --skip-themes plugin deactivate --all
Without WP-CLI, rename the folder over SSH or SFTP:
mv wp-content/plugins/some-plugin wp-content/plugins/some-plugin.off
If it’s the theme, switch to a default theme:
wp --skip-themes theme activate twentytwentyfive
(Install a default theme first if none is present: wp theme install twentytwentyfive.)
Common causes and fixes
| Error message contains | Cause | Fix |
|---|---|---|
Call to undefined function / Class not found |
Plugin incompatible, or a required plugin missing | Update or remove the plugin |
Allowed memory size … exhausted |
PHP memory limit too low, or a leak | Raise WP_MEMORY_LIMIT/memory_limit. See WordPress memory limit |
syntax error, unexpected … |
A bad code edit (often functions.php) |
Undo the edit via SSH/SFTP |
| Errors after a PHP upgrade | Old code not compatible with PHP 8.x | Update plugins and themes, or temporarily switch the PHP version. See PHP versions on Ubuntu |
Maximum execution time exceeded |
Long-running task | Raise max_execution_time, or move the task to cron |
Error in wp-includes/ |
Damaged core files | wp core verify-checksums, then reinstall core |
Step 4: after the site is back
- Update the plugin or theme (or replace it), and check the plugin’s changelog and support forum for known issues.
- Turn off
WP_DEBUGagain. - Re-enable other deactivated plugins one by one.
- Set up mail so future recovery emails arrive.
- Consider testing updates on staging first. See WordPress staging site and update WordPress safely.
Still broken?
- Restore from backup if a bad update damaged files or data. See WordPress backup without a plugin.
- Check disk space (a full disk breaks sessions, caches and updates). See disk full troubleshooting.
- Malware can also trigger fatal errors. See WordPress malware removal.
Quick reference
| Task | Command |
|---|---|
| Read PHP errors | tail /var/log/nginx/error.log, wp-content/debug.log |
| Deactivate all plugins | wp --skip-plugins plugin deactivate --all |
| Disable one plugin manually | rename its folder |
| Default theme | wp --skip-themes theme activate twentytwentyfive |
| Verify core | wp core verify-checksums |
Related: WordPress white screen of death and WordPress 500 error.