WordPress White Screen Of Death – How To Fix It

By , Updated: December 7, 2016

wordpress white screen of death

I’ll walk you through the possible issues, the most frequent causes and – most importantly – the solutions to them so you can get your site back up and running as fast as possible.

WordPress White Screen of Death

A WordPress white screen of death (WSOD) is almost always caused by PHP code errors or memory limit exhaustion’s. The first thing you should do is determine whether or not the admin is working. If the front-end of the website is down but the admin is working, chances are you have a faulty theme or plugin.

Disabling Plugins And Themes

Due to this, the best way forward is to disable all your plugins. If this fixes the issue you’ll need to find the culprit. Start activating them one by one, reloading the site after each activation. When your front-end goes down, you’ve found the misbehaving plugin.

If this didn’t help, you should replace your theme temporarily with a default WordPress one, Twenty Fifteen is a good choice. If your site pops back up the issue is within your theme.

Switching On Debugging

If your site is still down, or the admin isn’t working (or if you’ve found the culprit but want to dig deeper) you can enable debugging which will expose any errors.

The issue is that when a fatal error occurs the script simply ends execution. If this happens before any content is displayed, all you’ll see is a white screen with absolutely no text.

To enable debugging you’ll need to open the wp-config.php file of your WordPress install. Within you should fine the following line:

define( 'WP_DEBUG', false )

You’ll need to replace false with true and reload your site. Instead of the white screen, you’ll get a white screen and error messages. Not a huge improvement, but at least we can get started!

If you haven’t disabled plugins and themes yet you’ll be able to figure out which one the culprit is by looking at the error message. It should state which file the error originates in, something like this:

Cannot redeclare get_posts() (previously declared in /var/www/html/wordpress/wp-includes/post.php:1874) in /var/www/html/wordpress/wp-content/plugins/my-test-plugin/my-test-plugin.php on line 38

You can see at the end of the message that the problem is in line 38 of a plugin called “my-test-plugin”. Disabling that plugin should work.

If you’re happy with modifying code you may also be able to fix it. If this is a plugin from the repository, I recommend writing to the author instead of doing it yourself though. If you modify the plugin you’ll have to maintain all your changes which is a headache, it’s easier to deactivate it until it is fixed by the developer.

Increasing Memory Limits

If you still see an empty page or get an error complaining about memory limits or exhausted memory you’ll need to assign more memory to the application. This can be done through the wp-config.php file on many installs, just add the following code to the file:

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

If this doesn’t seem to work you have a few options. In a regular environment you can use your .htaccess file – in the WordPress root directory – to increase the memory limit, simply add the following line:

php_value memory_limit 64M

If you’re on an awesome host like Kinsta and your website runs lightning fast because the architecture uses nginx, .htaccess is not available. You can use your php.ini file to increase the memory limit. Anywhere inside the file add the following line:

memory_limit = 64M

If you’re still out of memory and you need to assign more and more, there may be an issue within your application. Perhaps your theme or one of your plugins is using an inordinate amount of resources. Ask a developer to take a look, even your host may be able to help by showing you the SQL logs and other resource stats.

File Permission Issues

I haven’t seen a white screen of death due to this, but permission and ownership issues can still cause problems. Who knows, in some circumstances it may lead to a white screen of death!

It is possible to fix this yourself, but unless you really know what you’re doing I would advise against it. For WordPress there are three simple rules:

  • files should be 664,
  • folders should be 775,
  • and the wp-config.php file should be 660

If you have SSH access to your server you can apply the appropriate rules with the following command, running it from the root WordPress directory.

sudo find . -type f -exec chmod 664 {} +
sudo find . -type d -exec chmod 775 {} +
sudo chmod 660 wp-config.php

If you are unsure how to do this or are a bit scared go ahead and ask your host, I’m sure they’ll help you out. Some WordPress-specific hosts even have automatic permission checking which can figure all this out for you.

Failed Auto-Update

Rarely WordPress may run into an issue with updates, like the server timing out. More often than not, this resolves itself automatically, but in some wild cases it may lead to a white screen of death.

The first thing you should do is go into your WordPress root directory and see if there’s a .maintenance file in there. Feel free to delete that file and load up your site again. If the update was successful – but WordPress failed to remove this file automatically – everything will go back to normal.

If the update was not completed it may be done automatically for you, in which case things should go back to normal just the same. If all else fails, follow the recommended WordPress manual update procedure which should resolve the issue once and for all.

Overview

There are a number of things that can go wrong, but thankfully the situation is usually not as dire as it seems. A simple plugin/theme check should fix the issue and enabling debugging will definitely shed more light on the problem.

If you’ve encountered any other WordPress white screen of death situations let us know so we can learn from it and share the experience!