The 'White Screen of Death' (often referred to as a WSOD), is when your Wordpress site, or particular pages, shows a blank white page. We know this can cause panic for our clients but with a few simple steps, you can find the source of the error and resolve it!
What Causes the White Screen of Death?
The white screen of death is a symptom of PHP coding errors or database errors and is typically caused by either a plugin or the site’s theme. The simplest fix is usually to change your theme or disable plugins, but some simple debugging can help you to quickly identify the cause.
How to Fix the White Screen of Death Issue
The first thing to do when encountering the white screen of death is to check your website’s error log.
If you're on our Cloud, Business, or VPS plans (anything cPanel-based) then this will show within an `error_log` file within the websites directory. For example, if the white screen of death appears on the front-end of your website, the `error_log` file in the main site directory should contain the error. If the white page only appears within your website’s Dashboard (wp-admin), then this file may be within `wp-admin/error_log`
If there isn’t anything displayed in the usual Error Log location, you may need to enable extra debugging. This can be done by adding the following to your site’s `wp-config.php` file:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'SCRIPT_DEBUG', true );
If you then refresh the white screen of death page, a file called `debug.log` within your site’s wp-content folder will populate with more details. It's recommended to disable debug logging again once you've resolved the issue so that this file doesn't get unnecessarily large.
Types of Errors you can Encounter with the White Screen of Death
Most errors will indicate the plugin/theme at fault. For example:
`Parse error- syntax error, unexpected $end in /home/user/public_html/wp-content/themes/twentynineteen/functions.php on line 278`
Here we can see the path to the file (functions.php) which is causing the error. As it's within the `twentynineteen` folder changing to a different theme will resolve the issue.
If you're unable to change the theme via wp-admin due to it being inaccessible, you can simply rename the relevant folder (`twentynineteen` in this case) to something else, such as `twentynineteen.disabled` On cPanel hosting packages, this can be done via File Manager or FTP.
Another example error is the following:
`Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes) in /home/user/public_html/wp-includes/plugin.php on line xxx`
Here we can see that a file on the site is exhausting its available PHP memory. In most cases, this is an easy fix!
On cPanel-based hosting packages, the `memory_limit` can be increased using the 'Select PHP Version' tool within your cPanel account. Please see the following guide for more details on this if you get stuck by clicking here.
What if nothing is being logged?
If nothing is being logged (even with debug mode on), the likelihood is there are permissions issues or missing core Wordpress files.
The easiest way to resolve permission issues is via SSH:
See here for our guide for using SSH with cPanel.
You can then navigate to the directory of your website.
If all else fails?
If you’re still seeing the white screen after following the steps above, it may be time to restore your site to a previously working state. For cPanel packages see our guide here.
If you have any more questions about the WordPress white screen of death or any other related queries, our support team are available 24/7. You can get in touch with us via support ticket, live chat or telephone, here.