I'm working on a small plugin and on some WP installations it throws up the white screen of death.

I'm new to this, and would like to know if there is a decent guide out to there (so far my googling over the white screen of death hasn't turned up anything for developers), or some best practices I should be following to make sure I catch errors or avoid anything foolish.

Any and all links or tips would be massively appreciated.

1 Answer 1


A white screen of death is typically a fatal PHP error, most of the time due to a syntax error. This often sends no errors to the browser.

Some things you can do:

Turn on PHP error_log in your php.ini file and set the error_reporting levels. http://php.net/manual/en/errorfunc.configuration.php

Error info: http://www.php.net/manual/en/errorfunc.constants.php

Alternatively or in combination you can turn this on in your wp-config as well (from wordpress codex). http://codex.wordpress.org/Editing_wp-config.php

 * This will log all errors notices and warnings to a file called debug.log in
 * wp-content only when WP_DEBUG is true

define('WP_DEBUG', true); // false
if (WP_DEBUG) {
  define('WP_DEBUG_LOG', true);
  define('WP_DEBUG_DISPLAY', false);

Turn on WordPress debugging and saved queries, (wp debug is same as above example) in your wp-config.php.

define('WP_DEBUG', true);
define('SAVEQUERIES', true);

And install the debug bar, http://wordpress.org/extend/plugins/debug-bar/

I also recommend using something like xDebug,

  • Thanks. That's a great start. I'd never run across the WSOD before so this should get me on the right track to writing some more robust code!
    – josh
    Dec 20, 2011 at 18:47
  • 1
    Can't believe I didn't know about the debug bar. Very handy.
    – josh
    Dec 21, 2011 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.