How to Enable Debug Mode in WordPress

May 27, 2024 / WordPress

This guide will teach you how to enable debug mode in WordPress. It helps in showing any errors with your WordPress site.

Follow the steps:

  1. Edit the wp-config.php file for your website by altering-
    define(‘WP_DEBUG’, false);
    
    to
    
    define(‘WP_DEBUG’, true);
  2. On the second line, type the succeeding-
    define(‘WP_DEBUG_LOG’, true);
  3. Save your changes.
  4. Visit your website to trigger the debugging log using an Internet browser.
  5. Open /wp-content/debug.log using the editor in your hosting account.
  6. Study the debug log’s contents to identify the possible cause of the problem. Any PHP errors encountered can reveal whether a specific plugin, theme, or configuration option is responsible for the problem, as indicated by the file path. For instance, the error below is attributed to a theme-
    Fatal error: Call to undefined function functionName() in

    /home/wp-content/themes/twentyeleven/functions.php on line 1

    Likewise, core file errors will reference ‘wp-admin’ or ‘wp-includes’ in the file path-
    Fatal error: require(): Failed opening required ‘/home/user/public_html/wp-includes/class-wp.php’

Please note- Adhering to these instructions will deactivate the Content Delivery Network for your WordPress site. After identifying the root cause of the problem, ensure to revert WP_DEBUG and WP_DEBUG_LOG settings to false, and subsequently delete the debug.log file.

In this way, you can enable debug mode in WordPress. If you encounter any issues, feel free to contact our support staff at your earliest.

Spread the love