"There has been a critical error on this website": find the cause and fix it

Updated 2026-10-16 · 6 min read · by the IsHacked team

Since WordPress 5.2, a fatal PHP error shows "There has been a critical error on this website" instead of a blank white screen. The message hides the details from visitors, which is good, but you still need them to fix the site.

Check your site for errors now

1. Check the recovery mode email

WordPress emails the site's admin address when it catches a fatal error. The email names the plugin or theme that crashed and contains a recovery mode link that lets you log in with the broken extension paused. Check the spam folder too; if the site's email isn't set up properly, read SPF, DKIM and DMARC for WordPress.

2. Read the error log

Add these lines to wp-config.php, above "That's all, stop editing":

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Reload the page and open wp-content/debug.log. The last PHP Fatal error line names the file and line. Your host's PHP error log has the same information.

3. Disable the culprit without wp-admin

Related errors

Error establishing a database connection

The database server is down, overloaded, or the credentials in wp-config.php changed. Check with the host before changing anything; if a hack is suspected, a changed database password can also be the attacker's doing.

Briefly unavailable for scheduled maintenance

An update was interrupted and left a .maintenance file in the WordPress root. Delete it, then re-run the update that failed.

HTTP 500 with no message

The error happens before WordPress can show its own screen: a broken .htaccess, a PHP syntax error in wp-config.php, or a server problem. The host's error log tells you which.

Afterwards

Turn debugging off and delete debug.log. An outside check that looks for error screens on the homepage tells you within the day when the next update breaks something, instead of when a customer calls.

FAQ

Does the critical error mean my site was hacked?

Usually not: it is most often a plugin or theme update, or a PHP version change. But malware that breaks a file can cause it too, so if no update happened, check for modified files.

Is it safe to leave WP_DEBUG on?

Leave WP_DEBUG_LOG on only while you investigate, keep WP_DEBUG_DISPLAY off, and delete wp-content/debug.log afterwards: a public debug log reveals server paths and sometimes data.

Related guides

Hacked WordPress cleanup checklist: every place malware hides

Step-by-step cleanup for a hacked WordPress site: backdoors in mu-plugins and uploads, fake plugins, cron, database payloads and rogue admins.

How to check if your website is hacked

12 practical tests to tell if a website or WordPress site is hacked: cloaked spam, mobile-only redirects, injected scripts and exposed files.

Send feedback

A bug, an idea, a question about this page: anything. It goes straight to the founder.