Skip to content

WordPress White Screen or Critical Error: How to Find and Fix the Cause

2 min read

Applies to: WordPress 7.1 on cPanel hosting, VPS and dedicated servers

When a plugin, theme or PHP problem crashes WordPress, visitors see a blank white page or the message “There has been a critical error on this website.” We reproduced this on WordPress 7.1.2 with a broken plugin: both the site and /wp-admin returned HTTP 500 with that message, and renaming the plugin’s folder fixed it instantly.

1. Check your email

WordPress sends the site’s admin email address a message with the name of the plugin or theme that failed and a special recovery mode link. Through that link you can log in and deactivate the culprit.

2. Find the exact error

Turn on WordPress’s error log in wp-config.php (cPanel File Manager › Edit), above the line /* That's all, stop editing! */:

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

Load the page again, then open wp-content/debug.log. The last lines name the file and line that failed, for example thrown in /wp-content/plugins/broken/broken.php on line 3. Set WP_DEBUG back to false when you are done.

3. Disable the plugin or theme

  • Plugin: rename its folder in wp-content/plugins (for example broken to broken.off). WordPress deactivates it. To rule out all plugins, rename the whole plugins folder, then rename it back and reactivate plugins one by one.
  • Theme: rename the active theme’s folder in wp-content/themes; WordPress falls back to a default theme if one is installed.
  • With SSH: wp plugin deactivate plugin-name --skip-plugins or wp plugin deactivate --all --skip-plugins.

Other common causes

  • PHP version: an old plugin may not work with a newer PHP version. Check the log, update the plugin, or change the PHP version in cPanel.
  • Memory limit: Allowed memory size exhausted in the log; see increasing the PHP memory limit for WordPress.
  • A failed update: a leftover .maintenance file keeps the site in maintenance mode; see maintenance mode and the .maintenance file.
  • Full disk or database errors: the log or “Error establishing a database connection” points there.

Stuck? Our engineers can find and fix it for you: hire an expert.

Was this answer helpful?

Still stuck? Open a ticket