Skip to content
Knowledge base

WordPress critical error: find the cause and get told next time

What the message means, why the recovery email often never arrives, and how to be told the moment it happens again: PHP errors in Errors and a check on the page.

1. What the message means

WordPress shows "There has been a critical error on this website" when PHP hits a fatal error, almost always in a plugin or theme, often right after an update. WordPress answers the page with HTTP status 500 and tries to email the site's admin address a recovery-mode link that signs you in with the broken plugin or theme paused.

2. Why the recovery email does not arrive

WordPress sends it with the server's own mail function, which many hosts do not deliver or which lands in spam. It goes to the admin email in Settings, General (or the RECOVERY_MODE_EMAIL constant, if set), and WordPress sends it at most once a day for the same problem, so a second failure the same day sends nothing.

3. Find the cause yourself

Add define('WP_DEBUG', true); and define('WP_DEBUG_LOG', true); to wp-config.php, load the page once, and read wp-content/debug.log: the last fatal error names the file and line. If you cannot reach the dashboard, rename that plugin's folder in wp-content/plugins over SFTP to switch it off. Turn WP_DEBUG back off afterwards.

4. Send PHP errors to RealUptime Errors

Install the WordPress plugin wp-sentry (the free "WordPress Sentry" plugin) and add define('WP_SENTRY_PHP_DSN', 'https://<key>@ingest.realuptime.io/<key>'); to wp-config.php, using the DSN from your Errors project's "Point any Sentry SDK here" panel. The next fatal error arrives as an issue naming the plugin file and line, with the WordPress version, and alerts you on your usual channels. Errors Free covers 10,000 events a month.

5. Watch the page from outside

Add an http monitor on your home page (and your checkout, if you sell). A critical error answers with status 500, so the check fails on the status code alone; for a host that rewrites errors to 200, add a body assertion "does not contain" with the text "There has been a critical error". You are alerted when the site breaks, whether or not WordPress manages to send its email.

Go deeper

The full reference lives in the docs: Getting started documentation. Error codes named above are each explained in the error-code reference.