Print

Enable WordPress Debug Log

Sometimes you get an error 500 or a blank page when you are opening your WordPress website. To find out which plugin or broken code is causing that error you need to tell WordPress to write errors into a log file or to show them on the screen instead of showing just the white blank page.

You can enable the WordPress debug mode by editing a few lines in the wp-config.php file of your WordPress installation.

To enable debugging mode in WordPress, follow these steps:

  1. Login to cPanel or log in to your site via FTP
  2. Use the cPanel File Manager or your FTP client to edit the file wp-config.php
  3. Add the lines below to the wp-config.php or if they already exist just change their values:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

After reloading the website all errors will be written into the file debug.log which is located in the folder: wp-content/debug.log

If you want to see the errors directly on the screen instead of having the need to look into the debug.log change WP_DEBUG_DISPLAY to
define( 'WP_DEBUG_DISPLAY', false );

When we ask you to do so please send us the debug.log file.
This file helps us to resolve issues you have with WP Staging.

WordPress Debug Log not Created

Some hosting providers[1] do not create the WordPress debug.log at all. They catch all errors and warnings which are created by WordPress and write them into a separate log file. So if the debug.log is not created check if there is another file in the root of your website like error_log or a folder like /logs.

If you do not see any error logs at all please ask your hosting provider where they store the log files.

Alternatively, you can try to set in the wp-config.php
define( 'WP_DEBUG_DISPLAY', true);

If this works you will see the relevant errors on the front end. This will help you to resolve the fatal error which you get, but this should also be used only in the last instance because your visitors should not be faced with such error messages for security purposes. So when you do not need it any longer make sure to switch the value back to false.

You find more detailed Instructions about how to enable the WordPress debug mode at https://codex.wordpress.org/Debugging_in_WordPress

At the time of writing this article: [1]  HostGator