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.
- Browser
- DNS
- HTTPS
- CDN or firewall
- Web server
- PHP (this error comes from here)
- WordPress
- Database and files
What causes it
A plugin has an error in its code
CommonA plugin was updated to a version with a fault, or two plugins clash, or a plugin does not work with the version of PHP the server runs.
Fix: Use the recovery link WordPress emailed you, or Find the plugin at fault and switch it off
The theme has an error in its code
CommonA theme update introduced a fault, or a snippet pasted into the theme's functions.php has a mistake in it.
Fix: Use the recovery link WordPress emailed you, or Switch to another theme
The page ran out of memory
SometimesThe page needed more memory than PHP allows. The error log will say "Allowed memory size exhausted".
How to fix it
Use the recovery link WordPress emailed you
- Easy
- No risk
- About 5 minutes
Step 1: Open the email and follow its link
The link opens your login page in recovery mode. It works for one day.
Step 2: Log in as usual
The dashboard loads with the faulty plugin or theme paused for you alone. Visitors still see the error.
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.
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
Step 1: Turn the debug log on
In
wp-config.php, find the linedefine( 'WP_DEBUG', false );and replace it with these three. They record the error in a file without showing it to visitors.wp-config.phpdefine( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false );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.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 throughwp-content/themes/points at the theme: use the next fix instead.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-offto its name. WordPress can no longer find the plugin and switches it off.Step 5: Reload the site
It loads without that plugin. Its settings are kept, and return when you install a working version.
Step 6: Turn the debug log off
Put the line back to
define( 'WP_DEBUG', false );and deletedebug.log, which can hold details you do not want on a public server.
With WP-CLI, turn the log on:
wp config set WP_DEBUG true --raw
wp config set WP_DEBUG_LOG true --raw
wp config set WP_DEBUG_DISPLAY false --rawThen 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:
wp plugin deactivate plugin-folder-name --skip-plugins --skip-themesAnd turn the log off again:
wp config set WP_DEBUG false --raw
wp config set WP_DEBUG_LOG false --rawSwitch 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.
Step 1: Rename the active theme's folder
In
wp-content/themes/, rename the folder of the theme the log named.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.
Step 3: Reload the site
If it loads, the theme was the cause. If you pasted code into the theme's
functions.phpshortly 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:
wp theme activate other-theme-folder-name --skip-plugins --skip-themesWhen 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.
- GuideLocked out of WordPress admin: find which lockout you have and get back in
- GuideSlow WordPress admin: how to find the cause and fix it
- ResourceWooCommerce checkout is down: a runbook
- GuideWordPress site not showing up on Google: what to check, in order
- Guideadmin-ajax.php high CPU usage in WordPress: how to find what is calling it
- GuideHow to change WordPress permalinks without breaking your old links

