WordPress: "There has been a critical error on this website", how to fix it
2808 viewsThe message appears when a PHP error stops WordPress from working. It's usually caused by a plugin, the theme or the PHP version. WordPress often also emails the administrator with details and a "recovery mode" link: check that first.
Steps
1. Find out what the error is
With your control panel's File Manager (or FTP), open wp-config.php and change the line define('WP_DEBUG', false); to:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
Reload the page. The error is written to wp-content/debug.log and usually says which plugin or theme is to blame. When you're done, set WP_DEBUG back to false.
2. Plugins
Rename the wp-content/plugins folder to plugins_off. If the site opens, a plugin is to blame: rename it back to plugins and deactivate them one by one from the admin area until you find which one.
3. Theme
Rename the active theme's folder inside wp-content/themes. WordPress will fall back to a default theme, if one is installed.
4. PHP version
If the problem started after a PHP version change, switch back to the previous one: cPanel or Plesk.
5. Restore
If you have a backup from before the problem, you can restore it: cPanel or Plesk. In Plesk, if the update was done with a Restore Point, you roll back from WordPress Toolkit.
If you can't fix it, open a support ticket with your domain and, if you have it, the message from debug.log.