Skip to content

How to fix the WordPress white screen of death

A blank page, or "There has been a critical error on this website", means PHP hit an error it could not recover from, almost always in a plugin or the theme. Switching that one plugin or theme off brings the site back. The error log names which one.

By
WP Ministry
Published
Tested on
WordPress 7.1.3, PHP 8.3.35

In short

  • Your content is safe. One piece of code failed, and WordPress stopped instead of showing a half-built page.
  • WordPress may have emailed the site's administrator a link that lets you log in with the faulty plugin paused.
  • The error log names the file that failed. The folder it is in tells you which plugin or theme to switch off.
  • Switching a plugin off loses none of its settings. You can switch it back on once it is fixed.

The "white screen of death" is what people call a WordPress site that shows nothing at all. Since WordPress 5.2 the page is rarely pure white: it usually says "There has been a critical error on this website." Both mean the same thing, and the page about that message starts from the sentence itself. PHP, the language WordPress runs on, hit an error it could not carry on from, and WordPress stopped rather than show a broken page.

Nothing has been deleted. The site returns as soon as the code that failed is switched off or fixed.

Before anything else, check your email

When this happens, WordPress emails the address of the site's administrator with the subject "Your Site is Experiencing a Technical Issue". The email names the plugin or theme at fault and holds a link. If you have that email, the first fix below is the quickest way back in.

If the log says "Allowed memory size exhausted"

Then nothing is faulty in the way described above: a page needed more memory than PHP allows. See how to fix "Allowed memory size exhausted".

Where it goes wrong

A page request passes through each of these in turn. This one comes from PHP, the language WordPress runs on.

  1. Browser
  2. DNS
  3. HTTPS
  4. CDN or firewall
  5. Web server
  6. PHP (this error comes from here)
  7. WordPress
  8. Database and files

What causes it

How to fix it

Use the recovery link WordPress emailed you

  • Easy
  • No risk
  • About 5 minutes
  1. Step 1: Open the email and follow its link

    The link opens your login page in recovery mode. It works for one day.

  2. Step 2: Log in as usual

    The dashboard loads with the faulty plugin or theme paused for you alone. Visitors still see the error.

  3. Step 3: Switch the faulty plugin or theme off

    A notice at the top says which one was paused. Go to Plugins and deactivate it, or to Appearance, then Themes, and activate another theme.

  4. Step 4: Leave recovery mode

    Use the "Exit Recovery Mode" button in the top bar, then reload the site.

No email? It may have gone to an old address, or the site may not be able to send mail. Use the next fix.

Find the plugin at fault and switch it off

  • Takes care
  • Low risk
  • About 15 minutes
  • Steps tested on WordPress 7.1.3
  1. Step 1: Turn the debug log on

    In wp-config.php, find the line define( 'WP_DEBUG', false ); and replace it with these three. They record the error in a file without showing it to visitors.

    wp-config.php
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
  2. Step 2: Load the site once, then open the log

    Open wp-content/debug.log. Find the newest line that begins "PHP Fatal error". It ends with the path of the file that failed.

  3. Step 3: Read the folder name in that path

    A path through wp-content/plugins/ followed by a folder name points at that plugin. A path through wp-content/themes/ points at the theme: use the next fix instead.

  4. Step 4: Rename that plugin's folder

    In your host's file manager or over SFTP, open wp-content/plugins/ and rename the plugin's folder, for example by adding -off to its name. WordPress can no longer find the plugin and switches it off.

  5. Step 5: Reload the site

    It loads without that plugin. Its settings are kept, and return when you install a working version.

  6. Step 6: Turn the debug log off

    Put the line back to define( 'WP_DEBUG', false ); and delete debug.log, which can hold details you do not want on a public server.

With WP-CLI, turn the log on:

bash
wp config set WP_DEBUG true --raw
wp config set WP_DEBUG_LOG true --raw
wp config set WP_DEBUG_DISPLAY false --raw

Then switch the plugin off, using its folder's name. The two extra options stop WP-CLI from loading the broken plugin itself, which would stop the command too:

bash
wp plugin deactivate plugin-folder-name --skip-plugins --skip-themes

And turn the log off again:

bash
wp config set WP_DEBUG false --raw
wp config set WP_DEBUG_LOG false --raw

Switch to another theme

  • Takes care
  • Low risk
  • About 10 minutes
  • Steps tested on WordPress 7.1.3

If the log's path runs through wp-content/themes/, the active theme is at fault. Switching to another theme brings the site back while you sort the first one out. Your content is not affected, though the site will look different until you switch back.

  1. Step 1: Rename the active theme's folder

    In wp-content/themes/, rename the folder of the theme the log named.

  2. Step 2: Log in and open the Themes screen

    Go to Appearance, then Themes. WordPress says "The active theme is broken. Reverting to the default theme." and switches to a default theme if one is installed. It makes the switch on that screen, not when the folder is renamed.

  3. Step 3: Reload the site

    If it loads, the theme was the cause. If you pasted code into the theme's functions.php shortly before this began, that code is the likeliest fault: remove it, then rename the folder back.

With WP-CLI, activate another installed theme by its folder's name:

bash
wp theme activate other-theme-folder-name --skip-plugins --skip-themes

When to get help

If the log points at WordPress's own files rather than a plugin or theme, or the site stays blank with every plugin off and a default theme active, something deeper is wrong, such as files damaged by a failed update. That is a job for someone with access to the server.

Common questions

Have I lost my site?

No. Your posts, pages, settings and uploads are untouched. Only the code that builds the page failed.

Will switching a plugin off delete its data?

No. Deactivating a plugin, or renaming its folder, leaves its settings and data in the database. Deleting the plugin from the Plugins screen is what removes them, and only for some plugins.

Why is the page blank instead of showing an error?

WordPress hides error details from visitors on purpose, because they can reveal how the site is built. The details go to the log when you ask for one.

It happened right after an update. Can I go back?

Yes. Switch the plugin off as above, then install its previous version, or restore the site from the backup taken before the update.

More on this subject

Would you rather we fixed it?

Emergency Fix is $99. Site down or checkout broken. Goes to the front of the queue. No fix, no fee. 30-day warranty. It starts with a free diagnosis.