White Screen of Death? Turn on WP_DEBUG

 

WordPress people will often talk about the “white screen of death” or WSOD. They’re referring to when a WordPress site just stops making web pages and instead offers only a giant white field. This is intimidating for anyone, but especially new developers who’ve never seen it before. Generally the issue will be caused by a plugin or theme that has gone wrong. But knowing which and why is not clear.

So, the first step to dealing with a silent and explanation-less error is to make it not be silent and explanation-less. In WordPress, this is pretty simple. It’s about a constant called WP_DEBUG. The video explains what to do:

How to Turn on WP_DEBUG to Solve WordPress Issues

  1. Connect to your WordPress site’s file system. This is probably via (S)FTP, or if it’s a local install it would just mean using your local computer’s file browser.
  2. Open the wp-config.php file. This is where WordPress has stored your database connection details and everything else. If you set WordPress up by hand, you may have manually editted this file, but that’s no longer very common.
  3. This file will probably already contain something that look like define('WP_DEBUG', false);. If so, you just need to change that false to a true. If it doesn’t already contain that line, you’ll need to add it. In either case, make sure that the file contains one (and only one) line defining WP_DEBUG as true. So you want: define('WP_DEBUG', true); to be the final result.
  4. Now is when you need to do some problem solving, which can be really intimidating if you’re not familiar with PHP. Basically, some PHP code was misbehaving, and causing your white screen. Now you’ll get a message that describes the specific cause of that issue to you. But each situation is very different, so you’ll need to use your own problem solving to really get to bottom of it. The further reading section below may help you.

Further Reading on the White Screen of Death

Spooky WordPress: Working with the WordPress White Screen of Death

And about debugging in general:

A Guide to Debugging in WordPress with your Reptilian Brain

And a more comprehensive guide from GoWP:

How To Fix Error Establishing A Database Connection In WordPress


1 Response

Comments

Add a Comment

Your email address will not be published. Required fields are marked *