Skip to main content

How to Enable WordPress Debugging

Enable WordPress debugging to identify the specific cause of errors, warnings, or "White Screen of Death" issues on your WordPress site. This process allows you to view detailed error messages directly in your browser or within a log file.

Enable WordPress debugging to identify the specific cause of errors, warnings, or "White Screen of Death" issues on your WordPress site. This process allows you to view detailed error messages directly in your browser or within a log file.

Before you begin

You will need:

  • Site Administrator access to your WordPress site.

  • Access to your site's files via an FTP client or a File Manager.

  • Access to the wp-config.php file located in your site's root directory.

Enable WordPress Debugging

  1. Connect to your site's files using an FTP client or your hosting provider's File Manager.

  2. Locate the wp-config.php file in the root directory of your WordPress installation.

  3. Open the wp-config.php file and search for the following line: define( 'WP_DEBUG', false );

  4. Change the value from false to true: define( 'WP_DEBUG', true );

  5. (Optional) To log errors to a file instead of displaying them on the screen, find or add the following lines below the WP_DEBUG line:

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

Confirm the result

  • If you enabled WP_DEBUG without WP_DEBUG_DISPLAY, the errors will be recorded in a file named debug.log located in the /wp-content/ directory.

  • If you enabled WP_DEBUG and WP_DEBUG_DISPLAY, error messages will appear directly on the page where the error occurs.

How to Disable WordPress Debugging After Troubleshooting

Once you have identified and resolved the underlying issue, you must disable debugging to ensure your site remains secure and professional.

  1. Open the wp-config.php file again.

  2. Locate the WP_DEBUG line.

  3. Change the value back to false: define( 'WP_DEBUG', false );

  4. If you added the WP_DEBUG_LOG and WP_DEBUG_DISPLAY lines, you may remove those lines or set their values to false.

Limitations

Enabling WP_DEBUG with WP_DEBUG_DISPLAY set to true can expose sensitive information about your server configuration or file paths to public visitors. Only use the display option during active troubleshooting.

Did this answer your question?