Skip to content

WordPress "There has been a critical error on this website" on cPanel

How to investigate the WordPress critical-error page on cPanel — the recovery-mode email link, the error log, and recovering the site without losing changes.

“There has been a critical error on this website” is what WordPress 5.2+ shows in place of the white screen of death. The advantage over the blank page is that WordPress also emails the site’s admin a recovery-mode link, which lets you bypass the broken plugin or theme and reach the dashboard. The disadvantage is that operators sometimes treat the email as the whole answer when it’s only the first step.

What’s happening

WordPress’s fatal-error handler catches the crash and renders a friendly page. Behind the scenes, it records the crash in _recovery_mode_keys and sends an email to the site’s admin email address with a recovery-mode link. Clicking the link logs you in with the offending plugin or theme deactivated for your session only, so you can investigate without taking the site further down. The crash itself is still in the PHP error log.

How to verify

Check the admin email defined in wp-config.php or in wp_options.admin_email:

wp option get admin_email

If that mailbox isn’t being read (a common state on takeover sites), you won’t get the recovery email and won’t notice until you find this article. Set it to something monitored:

wp option update admin_email ops@yourcompany.com

Then look at the error log to find the actual crash:

tail -100 ~/public_html/error_log
grep -i 'fatal\|critical' ~/public_html/error_log | tail

The fix

  1. If you got the recovery-mode email, click the link. WordPress will let you in with the broken extension disabled for the session. From there: deactivate the plugin or switch the theme, fix or roll back, then exit recovery mode.

  2. If you didn’t get the email (mailbox not monitored, mail not delivering), recover via WP-CLI:

    wp plugin list --status=active
    wp plugin deactivate --all
    wp theme list
    wp theme activate twentytwentyfour

    Then reload. The site should come back. Reactivate plugins one at a time, reloading between each, to identify the culprit:

    wp plugin activate one-plugin && curl -I https://example.com
    wp plugin activate another-plugin && curl -I https://example.com
  3. If the cause is a theme, you can switch via WP-CLI:

    wp theme activate twentytwentyfour

    Or by renaming the active theme’s folder, which forces WordPress to fall back to a default theme.

  4. Read the fatal in the error log. Common patterns:

    • PHP version mismatch (covered separately).
    • Missing function from a parent library that was uninstalled (e.g., a child theme whose parent was deleted).
    • A WordPress core function that was deprecated and finally removed (frequent during major-version upgrades).
  5. Address the root cause, not just the symptom. If a plugin throws under load only, “deactivate it” fixed the visible problem but not the underlying memory or capacity issue. Look further up the log for Allowed memory size or query timeouts.

  6. Confirm the admin email is now somewhere you’ll see. If your site is in a managed environment, point admin_email at a monitored shared mailbox or an alerting destination rather than an individual.

  7. Update the runbook. The next operator should know: where the error log lives, what admin_email points to, and which plugins are tolerated to fail vs. critical.

For environments where this needs proactive monitoring rather than reactive diagnosis, Stack Harbor handles it under enterprise WordPress.