Debug WordPress White Screen of Death and other Errors

After so many requests asking about “WordPress white screen of death”, I would like to quickly share my strategy I use in most of the WordPress installs I manage which allow me to quickly switch on debug mode when required.

In the file wp-config.php, which can be found in your WordPress root, search for variable WP_DEBUG and replace it with

if (isset($_GET['debug']) && $_GET['debug']=='debug_mode') {
    error_reporting(E_ALL); ini_set('display_errors', 1);
    define('WP_DEBUG', true);

Now you can open any page, and if something goes wrong there, like a white screen of death, you can add ?debug=debug_mode to the end of its URL and check what’s causing the trouble. Eg.

I hope this helps.

Leave a Reply

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

Please note: These tutorials are meant to be helpful, but please note that I can not and will not be able to help with any implementations or modifications.

tl;dr If you do not understand it, hire me to do it.