How to fix the White Screen of Death (WSOD) and WordPress critical error

The WordPress White Screen of Death and “There has been a critical error” are PHP fatal errors. Enable WP_DEBUG_LOG to find the cause in debug.log, then disable plugins, switch themes or raise the memory limit.

WordPress White Screen of Death (WSoD) error

Both errors usually trace back to one of four things: a plugin conflict, a theme issue, a PHP error or an exhausted memory limit. The steps below go through each one, starting with the quickest way to see the actual error behind the blank screen.

Difference between WSOD and critical error

White Screen of Death (WSOD): A completely blank screen with no error message. This typically points to a suppressed PHP error or an exhausted memory limit.

“There has been a critical error on this website”: Introduced in WordPress 5.2, this message replaces the WSOD in many cases. It provides a more informative notice and automatically emails the site admin a recovery link with details to help troubleshoot the issue. This feature is also called the recovery mode.

How to fix White Screen of Death

1. Enable debug mode

WordPress may hide error details for security reasons. This makes it hard to diagnose the main issue. To reveal them, enable debug mode by adding this to wp-config.php:

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

Next, refresh your site and check the wp-content/debug.log file for PHP fatal errors.

Once you’ve found the cause, set WP_DEBUG back to false. The debug.log file is publicly accessible by default and can expose file paths and other sensitive details.

2. Increase PHP memory limit

If errors are due to insufficient WordPress memory, increase the PHP memory limit by adding this to wp-config.php:

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

You can also set it in .htaccess:

php_value memory_limit 256M

Or in php.ini:

memory_limit = 256M

3. Disable plugins

Plugins are a common cause of both errors.

Try to deactivate plugins one by one and check if the error is resolved.

You may also rename the wp-content/plugins/ folder via FTP or File Manager to disable all plugins at once.

If the site loads, restore the folder name and reactivate plugins one by one to find the problem.

4. Switch to default theme

A faulty theme can break your site.

A critical error usually happens when your theme runs PHP code that’s incompatible with your PHP version. So, it’s common to see a critical error or WSOD immediately after updating the theme or changing PHP version.

If you can’t revert the theme update from a backup, rename your active theme folder (wp-content/themes/your-theme/) to force WordPress to switch to a default theme like Twenty Twenty-Five. If the site works, the issue lies with your theme.

5. Check for corrupt core files

Corrupt WordPress core files can trigger fatal errors.

Download a fresh copy of the same WordPress version you’re running from wordpress.org and replace (overwrite) the wp-admin and wp-includes folders.

6. Scan for malware

Malware infections can lead to WSOD and critical errors by injecting malicious code into files.

Scan your site externally using Sucuri SiteCheck. This is much faster compared to installing a plugin and running a full scan.

Additionally, use a security plugin like Wordfence, Sucuri, or MalCare to scan and remove malware.

In some severe cases, malware infections cannot be removed fully by using a security plugin. Consider getting help from a WordPress developer.

7. Restore from backup

If none of the solutions above resolve the issue, restore your site from a recent backup.

Hosting providers often offer backup tools, or you can use a plugin like UpdraftPlus.

Additional help

If the problem persists, check server error logs, see our complete guide to fixing a WordPress site that’s down, or request technical support from a WordPress Expert.

About the author

Ozgur Sar Avatar