Skip to content
The site is down

“There has been a critical error on this website”

A plugin or theme has crashed the site. How to find which one and get the site back up, even when you can't get into wp-admin.

You need
FTP
Updated

The message means PHP stopped with a fatal error, and WordPress shows this message instead of the page. The cause is nearly always a plugin or theme, for example an update with code that is incompatible with the rest of the site.

Visitors see only the short message. If you try to log in to wp-admin, you're told to check the site admin's email inbox instead.

Look for the email from WordPress

When the error happens in wp-admin or on the login page, WordPress tries to send an email to the administration email address under Settings. It names the plugin or theme that failed and contains a link to recovery mode.

  1. Search your inbox for an email from the site, and check the spam folder too.
  2. Open the link and log in. The plugin that failed is paused while you're in recovery mode.
  3. Go to Plugins, deactivate the plugin named in the email, and click "Exit Recovery Mode".

If only the front end crashes and wp-admin still works, no email is sent, but you can log in to wp-admin as usual and deactivate the plugin there. WordPress sends at most one of these emails a day. If it never arrives, email from the site may not be getting through at all, or the error isn't in a plugin or theme. Either way, you have to fix the error manually.

Deactivate the plugin over FTP

Without the email, you can deactivate a plugin by renaming its folder.

  1. Connect with FTP or the file manager in your hosting panel, and open wp-content/plugins.
  2. If you know which plugin you updated last, rename its folder, for example to forms-off.
  3. Reload the site. If it works, you have found the cause.
  4. If you don't know which plugin it is, rename the whole plugins folder. If the site then works, log in and open Plugins while the folder still has its new name. WordPress then deactivates all plugins. Rename the folder back to plugins, and activate the plugins one by one until the error returns.

With SSH and WP-CLI, you can deactivate the plugin without loading plugins and the theme, so the command doesn't crash on the same error:

wp plugin deactivate forms --skip-plugins --skip-themes

If the theme is the cause, do the same with its folder in wp-content/themes. Then log in and open Appearance → Themes. WordPress switches to a default theme only at that point, if one is installed.

Find the error in the log

To see exactly what failed, turn on the error log. Find the line define( 'WP_DEBUG', false ); in wp-config.php and replace it with these three lines:

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

If the line isn't there, add them just above the line with require_once ABSPATH . 'wp-settings.php';.

Reload the site and open wp-content/debug.log. The line with PHP Fatal error shows the file and line number where the error occurred, and the folder name tells you which plugin caused it. Set WP_DEBUG back to false and delete debug.log when you're done. Anyone can open the file in a browser, and the log can contain sensitive information.

When you're stuck

If the site still fails with all plugins deactivated and a default theme active, the cause may be in wp-content/mu-plugins, in files such as object-cache.php and advanced-cache.php in wp-content, in WordPress itself or in the PHP version at your host. The error log shows which file and line the error comes from. Without FTP access you can't take it further yourself, so whoever runs the site has to investigate.