Debug WordPress with WP_DEBUG

Is your WordPress site displaying a white page, that has nothing on it (also known as: the white screen of death)? Then there is most probably a fatal PHP error somewhere in your WordPress site. If you want to figure out what is causing this issue, follow these steps:

  1. access your server file system (via FTP or your hosting dashboard),
  2. locate your WordPress site installation folder (usually something like /public_html/your-wp-folder),
  3. you’ll find a wp-config.php file in this folder, which is a very important WordPress file, so be careful with it,
  4. edit the wp-config.php file and search for WP_DEBUG,
  5. usually the wp-config.php file already has this line of code in it:
    define( 'WP_DEBUG', false );, if this line is missing, then you can insert it right above the following line:
    /* That's all, stop editing! Happy blogging. */,
  6. once you have this line in the wp-config.php file, change the value from false to true, so it will look like this:
    define( 'WP_DEBUG', true );
  7. save the file,
  8. go to your WordPress page, that was displaying the white screen and refresh the page,
  9. the PHP error, should be visible now; you should copy that error and send it to the support team, they will be able to tell you what the issue is and how to solve it,
  10. after you have copied the error message, you should also disable the WP_DEBUG, because it should not be enabled on your production page,
  11. to do that, open the wp-config.php file again and change the value back to false, so it should look like this:
    define( 'WP_DEBUG', false );

You can also take a look at this video, for further clarifications:

That’s it! You successfully debugged a WordPress PHP error. Good job! 🙂