Home » wp-config.php » There Has Been a Critical Error on This Website: How to Fix It

There Has Been a Critical Error on This Website: How to Fix It

Your site shows a white page with one line: “There has been a critical error on this website.” Sometimes it adds “Please check your site admin email inbox for instructions.” Often wp-admin is broken too, so you cannot just deactivate the plugin that caused it.

This message is not the error itself. It is the screen WordPress shows when PHP hits a fatal error, and it hides the real error message from visitors. The fix is always the same: find the real PHP error, then disable or fix the plugin, theme or code snippet that throws it.

The page is sent with HTTP status 500, so uptime monitors and Google see it as a server error. I would not leave it up longer than you have to.


Since WordPress 5.2, the fatal error handler emails the site admin when a plugin or theme crashes the site. The subject looks like [Your Site Title] Your Site is Experiencing a Technical Issue, and the email names the plugin or theme and includes a secret recovery mode link.

Click that link and log in. WordPress pauses the broken extension only for your browser (it sets a cookie), and an admin notice shows which plugin or theme failed and the error message. From there you can deactivate it or update it. The core dev note on fatal error recovery mode explains how this pausing works.

Two things catch people out here. Recovery mode does not fix the site for visitors, it only lets you into wp-admin. And the email goes to the address in Settings > General (or the RECOVERY_MODE_EMAIL constant if you set one), which is often an old inbox nobody reads.

If there is no email, the link has expired, or the error happens before WordPress can tell which extension caused it, move on to the log.

Back up wp-config.php first. Then add these lines above the /* That's all, stop editing! */ comment. If any of these constants is already defined in the file, change the existing line instead of adding a second one.

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
there has been a critical error on this website wp config 1 - There Has Been a Critical Error on This Website: How to Fix It
Where it goes in wp-config.php: above the “That’s all, stop editing!” line

This writes errors to wp-content/debug.log without printing them on the page, which is what the official WordPress debugging guide recommends. Reload the broken page once so the error is logged, then read the end of the file:

tail -n 30 wp-content/debug.log

You are looking for a line that starts with PHP Fatal error or PHP Parse error. The file path in it tells you who to blame: wp-content/plugins/some-plugin/ is a plugin, wp-content/themes/your-theme/ is the theme, and a path to functions.php usually means a snippet someone pasted in.

If the file is not there after a reload, the log is not being written at all. I covered the usual reasons in debug.log Not Created in WordPress? Fix WP_DEBUG_LOG Fast. The server PHP error log should have the same fatal error line, so check that too.


Once you know the culprit, take it out of the loading order. With WP-CLI over SSH, skip all plugins and themes so the command itself does not hit the same fatal error:

wp plugin deactivate some-plugin --skip-plugins --skip-themes

WP-CLI should answer with a success line saying the plugin was deactivated. Replace some-plugin with the folder name from the error path.

If you do not know which plugin it is yet, deactivate everything and turn plugins back on one by one:

wp plugin list --status=active --field=name --skip-plugins --skip-themes > active-plugins.txt
wp plugin deactivate --all --skip-plugins --skip-themes

The first command saves the list of active plugins, so you know what to turn back on afterwards with wp plugin activate name. Reload the site after each one. The plugin that brings the critical error back is the one to fix.

See also  Prime Mover CVE-2026-115806: Update and Purge Planted Comments

If the error is in the theme, switch to a default theme you have installed:

wp theme list --skip-plugins --skip-themes
wp theme activate twentytwentyfive --skip-plugins --skip-themes

💡 wp theme activate only works with a theme that is already installed. Use a name from the wp theme list output.

No SSH? Rename the plugin folder over SFTP or in your file manager, for example wp-content/plugins/some-plugin to some-plugin.off. WordPress cannot find the plugin anymore and deactivates it. Renaming the whole plugins folder disables all of them at once. The phpMyAdmin method is in Disable WordPress plugins via FTP or within PHPMyAdmin.


Disabling the plugin gets the site back. Whether you can turn it on again depends on what the fatal error says. These are the ones I see most:

  • Allowed memory size of ... bytes exhausted: PHP ran out of memory. Raise WP_MEMORY_LIMIT or the PHP memory_limit, but also check why a single request needs that much. If the path points to object-cache.php, see Allowed Memory Size Exhausted in object-cache.php.
  • Call to undefined function or Class "..." not found: a plugin depends on another plugin that is inactive or was updated, or on a PHP extension the server does not load.
  • Parse error: syntax error, unexpected ...: broken PHP, almost always a snippet pasted into functions.php or a half-uploaded file. Remove the snippet or re-upload the plugin.
  • Errors that started right after a PHP version upgrade mean the plugin is not compatible with the new PHP. Update it, or switch the site back to the old PHP version until the developer releases a fix.

After the fix, turn the plugin back on and load the front end and wp-admin. If the critical error does not come back, check debug.log once more for new fatal errors.

Do not leave WP_DEBUG on in production. Set it back to false and delete debug.log, because anyone who requests /wp-content/debug.log can read file paths and other details from it.

define( 'WP_DEBUG', false );
there has been a critical error on this website wp config 2 - There Has Been a Critical Error on This Website: How to Fix It
Where it goes in wp-config.php: above the “That’s all, stop editing!” line

You may also find advice to add WP_DISABLE_FATAL_ERROR_HANDLER to wp-config.php. That constant turns off the critical error screen and recovery mode completely. It does not fix anything, and I would keep the handler enabled on a live site so you keep getting the recovery emails.

💡 Make sure the admin email address in Settings > General is one you actually read. That is where the recovery link goes the next time this happens.

If your server runs OpenPanel, you do not need SSH to find the error: Statistics > Error logs shows PHP fatal errors with their stack trace for all your sites, and you can search for Fatal error or wp-content. WordPress’s own debug.log is not listed there, but you can open it from the File Manager. In cPanel you would look at the Errors page or the error_log file in the site folder instead.


TL;DR: “There has been a critical error on this website” means a PHP fatal error. Use the recovery link from the admin email if you have it. Otherwise enable WP_DEBUG_LOG, read the fatal error in wp-content/debug.log, deactivate the plugin or theme from that path with WP-CLI or by renaming its folder, fix the cause, and turn debugging off again.

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended