How to Fix the WordPress White Screen of Death

WordPress White Screen of Death

Written by - Masood

August 16, 2017

If you have been using WordPress for a few years, then you have faced the white screen of death at least once. The WordPress white screen of death is one of those extremely annoying problems like errors in establishing a database connection. The reason why this issue is frustrating for users is that it locks you out of your WordPress admin panel. Because there is no error output in most cases, you are left clueless to figure out what is the issue.

The worst thing about the white screen of death is that sometimes it will only affect a certain part of your site. For example, you may only see the white screen of death on your WordPress admin while everything else works fine. In other cases, you may only see it on a specific post whereas everything else runs just fine. In this post, we will show you how to fix the WordPress white screen of death by looking few possible solutions.

Why do you get this error?

The majority of the time when you see a white screen of death, that means that you have exhausted the memory limit. This could be caused by a plugin that you are using and it’s not functioning properly. It could also be caused by a poorly coded theme that you are using. It could also mean that there is an issue with your web hosting server. Since the problem can be caused by any number of things, it may require a lot of troubleshooting.

Does the problem occur on your other sites?

If you have multiple sites, then the first thing you should do is to make sure that the white screen of death is happening just on this one domain. If the issue is with all of your websites, then it is a strong case that your web hosting provider is having some issues. However, if the issue is only with one of your websites, then this could be an issue with a plugin or theme that you are running. If the issue is only happening with a single post or page, then you know it is a problem with your specific website.

Increasing the Memory Limit

Usually, this issue happens because your memory is being exhausted. Use our tutorial on how to increase PHP memory in WordPress.

Disabling All Plugins

If increasing the memory limit did not sort out the issue, or if you have a high memory limit like 256M or 512M, then you need to start troubleshooting. In our experience, we have always found that the issue is either with a specific plugin or a theme. Let’s go ahead and disable all the plugins. If this fixes the issue, then enable one plugin at a time to get to the bottom of the issue.

Replace Theme with a Default Theme

If plugin troubleshooting doesn’t resolve the issue, try replacing your current theme with a default WordPress twenty theme. The best approach is to back up your theme folder and delete the theme, and WordPress will automatically revert to the default theme.

Alternatively, you can update the database tables in the wp_options table via phpMyAdmin. The following table names need updating: template, stylesheet, and current_theme. Change the value to twenty-eleven.

If this resolves the issue, inspect your theme’s functions.php file. If there are extra spaces at the bottom, consider removing them. Additionally, if you’re using poorly coded functions in your theme’s functions.php file, it can also cause this problem.

Other Fixes

If none of the above works, then you should try to reinstall a fresh copy of WordPress. While it is unlikely, it is always possible that a core file may have been corrupted.

You can also use the WordPress wp debug function to see what sort of errors are being outputted. Add the following code to your wp-config.php file.

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
define( 'WP_DEBUG', true)

After adding this, the blank screen will display errors, warnings, and notices. These can help you determine the root cause.

Sometimes, you can access the backend, but the front end of the website displays a white screen of death. This occurs due to the caching plugin. Simply empty your cache.

If a white screen of death appears only on a very long post page, then you should also try clearing the cache. Another trick we’ve found is increasing the recursion and backtrack limit. You can paste the following code into your wp-config.php file. Alternatively, on some servers, you may need to modify your PHP.INI file.

<?php
/** Trick for long posts **/
ini_set('pcre.recursion_limit',20000000);
ini_set('pcre.backtrack_limit',10000000);

We acknowledge that this error can be very frustrating, and we hope that one of the tricks mentioned above resolves the issue for you. Have you tried anything that appeared to work for you? If you’ve discovered another solution that proved effective, please share it with us. We’re keen to enhance this resource to spare others the time spent searching for a solution.

You May Also Like…