Overcoming the WordPress’ white screen of death

Yesterday’s incident with La Prensa Nicaragua reminded me that I wanted to write about this 6 months ago. So I took some time and wrote this up. I really hope this helps someone.

If you have ever played with WordPress, plugins and themes a bit, it is very likely that you have faced the dreadful white screen of death. This can be very frustrating and even irritating if you do not know where to look for clues. So below I’m sharing a few tips for what I normally do on these cases.

Option 1: Enabling WP_DEBUG on wp_config.php

The file named wp-config.php is where all the important settings are for your site are stored. You will find the database hostname, name, username and password for the MySQL instance that your site is using. But it also holds some other very important features, and one of them is the one we need to enable with the following line:

define( 'WP_DEBUG', true );

By default your wp-config.php comes with this setting set to false, just change it to true to enable the debugging feature. Once the debugging mode is enabled, your wordpress instance will now show you on screen all the errors from themes and plugins.

You can alternatively also enable the feature for wordpress to write a log of all the errors and not show them on screen; this is especially handy if you are debugging on a production environment and you do not want the visitors to notice the errors. You do that adding the following code to the file:

// Enable WP_DEBUG mode
define('WP_DEBUG', true);

// Enable logging to the /wp-content/debug.log file
define('WP_DEBUG_LOG', true);

// Disable display of errors and warnings 
define('WP_DEBUG_DISPLAY', false);

Once you have added this to the wp-config.php file, you can check all the error messages of your site on the file located on /wp-content/debug.log. You can now find what is the error that you are getting and start fixing it.

Option 2: Troubleshoot with a plugin

If you search on the WordPress’ Plugin repository you will find that there are several plugins that help you on your troubleshooting tasks. So if you still have access to the WordPress Dashboard, then you use any of the plugins.

To start up with I suggest you try one of these plugins:

If you are running a Multisite instance of WordPress, then I suggest you use a plugin that was done specifically for networks and super admins, and is called Debug This.

I suggest you try them and based on your preferences you pick your favorite and start finding all the errors.

Option 3: Check the Error log on your web hosting Control Panel

This works if you are using whether cPanel or Plesk.

cPanel instructions

On your cPanel go to Logs and then Error Log.

Plesk instructions

Go to Files, then on the left side select the Logs folder, and then scroll down to find the file named error_log.

For other web hosting control panels, you would have to do an online search to find the proper instructions where to find the error log. The same it goes if you are using a Linux instance without any control panel. Please look for your linux distribution to find the error log of the web server (either Apache or NGINX).

Other things you can do

Disable plugins

Sometimes upgrading the plugins can break your site. It sucks but its true. So you can simply disable any of them by renaming the folder of the plugin to something else.

A radical measure its just to rename the entire plugin directory (/wp-content/plugins/)

Disable the themes

Yup, even some themes have caused the White Screen of Death many times. Easiesy way to disable it, just like with plugins is to rename the theme folder (/wp-content/themes/yourtheme).

You can also go to the MySQL database for this wordpress website, and look for the table wp_options, and change the theme to one of the builtin themes like twenty fifthteen, twenty fourteen & twenty thirdteen.

.htaccess issues

This is another of the most common issues, faulty rules on .htaccess. It can be a wrong rewrite, redirect or even a wrong add directive.

The good news is that errors caused by .htaccess are visible on your error_log. You can find that file based on your system configuration (cPanel, Plesk, Linux, Windows, etc).

Be sure to check Apache’s documentation for .htaccess. Or simply grab a clean version of the htaccess from WordPress’ Codex and backup the one you have for security purposes. Using the clean version of .htaccess will most likely solve the errors if you do not have time to troubleshoot and need the site back online asap.

If you want me to lend you a hand, contact me so we can take a look at your issue.

Published by Sal Aguilar

IT Pro that focuses in solving problems and providing solutions for customers.

Leave a comment

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: