All posts

Blog

How to Fix the WordPress White Screen of Death (and "There Has Been a Critical Error")

Illustrated cover for the WordPress guide "How to Fix the WordPress White Screen of Death (and "There Has Been a Critical Error")"

You visit your website and see a blank white page, or the message "There has been a critical error on this website." It's alarming, but it's almost always fixable, and your content is usually perfectly safe in the database.

This guide walks through the causes and fixes, from easiest to most technical.

What causes it?

The white screen (and the newer "critical error" message) usually means PHP hit a fatal error and stopped. The most common causes are:

  1. A plugin update or conflict
  2. A theme update or a code edit in functions.php
  3. Running out of PHP memory
  4. An incompatible PHP version
  5. A corrupted or incomplete update

Step 1: Check your email for recovery mode

Modern WordPress detects many fatal errors and sends an email to the site's admin address, with the subject "Your Site is Experiencing a Technical Issue". It includes:

  • Which plugin or theme caused the error
  • A special recovery mode link that lets you log in and fix it

Click the link, log in, and deactivate the plugin or theme it names. That's often the whole fix. Check your spam folder if you don't see it.

Step 2: Think about what just changed

If you just updated a plugin, installed a theme, edited code or changed PHP versions, that's almost certainly the cause. Undo that change first.

Step 3: Deactivate all plugins without logging in

If you can't get into /wp-admin, you can disable plugins through your hosting control panel.

  1. Log into cPanel or DirectAdmin and open File Manager.
  2. Go to your site's folder, usually public_html, then wp-content.
  3. Rename the plugins folder to plugins-off.
  4. Reload your site.

If the site comes back, a plugin was the culprit. Now:

  1. Rename plugins-off back to plugins. Your plugins will now be deactivated.
  2. Log into WordPress and reactivate plugins one at a time, checking the site after each.
  3. When the error returns, you've found the problem plugin. Leave it deactivated and check for an update, or replace it.

You can also rename just a single plugin's folder inside wp-content/plugins if you already suspect one.

Step 4: Switch to a default theme

If plugins weren't the cause, test the theme:

  1. In File Manager, go to wp-content/themes.
  2. Rename your active theme's folder, for example mytheme to mytheme-off.
  3. WordPress will fall back to a default theme if one is installed (such as a "Twenty" theme).

If the site loads, the problem is in your theme. Restore the folder name and check for an update, or undo any recent code edits to functions.php.

Step 5: Turn on debugging to see the real error

To see the actual error message:

  1. In File Manager, edit wp-config.php in your site's root folder.
  2. Find the line define( 'WP_DEBUG', false );.
  3. Replace it with:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
  1. Reload your site, then open wp-content/debug.log.

The last lines usually name the file and line that failed, which points straight at the plugin or theme. When you're done, set WP_DEBUG back to false and delete debug.log, since it can reveal information about your site.

You can also check the Errors or Error Log section in your control panel.

Step 6: Increase the PHP memory limit

If the log mentions "Allowed memory size exhausted", WordPress ran out of memory. Add this line to wp-config.php, above the line that says "That's all, stop editing!":

define( 'WP_MEMORY_LIMIT', '256M' );

If that doesn't help, your account's memory limit may be the real ceiling. A plugin that needs huge amounts of memory is often a sign of a problem with that plugin. Read hosting resource limits explained.

Step 7: Check your PHP version

Old plugins may not work on newer PHP versions, and new plugins may require them. If the error appeared right after a PHP change, switch back and update your plugins and theme before trying again. Look for Select PHP Version or MultiPHP Manager in cPanel, or the PHP version options in DirectAdmin. If you're not sure, ask your host's support team.

Step 8: Fix a stuck or failed update

If an update was interrupted, you may see "Briefly unavailable for scheduled maintenance". In File Manager, delete the .maintenance file in your site's root folder (you may need to show hidden files). Then rerun the update.

If WordPress core files are corrupted, you can replace the wp-admin and wp-includes folders with fresh copies from the same WordPress version. Don't overwrite wp-content or wp-config.php. If you're not comfortable doing this, restore from a backup instead.

Step 9: Restore from a backup

If you can't find the cause quickly, restoring a backup from before the problem is often the fastest route back online. Check your control panel for a restore tool such as JetBackup, or ask your host to restore it.

How to avoid it next time

Still stuck?

Contact your host's support team with your domain, what changed before the error, and any message from debug.log.