There was a problem loading the comments.

How to Enable WordPress Debug Mode (Step-by-Step Guide)

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

WordPress debug mode is a built-in tool that helps identify and fix errors on your website. Whether you're dealing with plugin conflicts, theme issues, or PHP errors, enabling debug mode can help you pinpoint the root cause quickly.

This guide explains how to activate WordPress debug mode manually or with a plugin, along with best practices to ensure safe troubleshooting.


Why Enable WordPress Debug Mode?

Enabling debug mode in WordPress allows you to:

  • View PHP warnings and errors

  • Log issues into a debug file

  • Test scripts and styles in development mode

  • Troubleshoot theme or plugin conflicts


How to Enable WordPress Debug Mode via wp-config.php

You can turn on debug mode by editing the wp-config.php file located in your WordPress root directory.

 

Step 1: Access Your wp-config.php File

Use an FTP client or your hosting file manager to navigate to the root directory of your WordPress installation.

Step 2: Enable Basic Debugging

Find the following line in wp-config.php:

 

define( 'WP_DEBUG', false );

 

Change it to:

 

define( 'WP_DEBUG', true );

 

If the line doesn’t exist, add it above this line:

 

/* That's all, stop editing! Happy publishing. */

 

Step 3: Enable Debug Logging

To save error messages in a log file, add the following:

define( 'WP_DEBUG_LOG', true );

 

This will create a debug.log file inside the /wp-content/ directory.

 

Step 4: Hide Errors from the Front-End

To prevent errors from showing on your website (recommended for live sites), add:

 

define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

 

Step 5: Enable Script Debugging (Optional)

To load non-minified versions of core JavaScript and CSS files (useful for developers), add:

 

define( 'SCRIPT_DEBUG', true );

Enable WordPress Debug Mode Using a Plugin

If you're not comfortable editing code, you can enable debug mode with a plugin.

Recommended Plugin: WP Debugging

  1. Go to Plugins > Add New in your WordPress dashboard.

  2. Search for WP Debugging and click Install Now.

  3. Activate the plugin. It will automatically configure all required constants in wp-config.php.


Debug File Location

When WP_DEBUG_LOG is enabled, all logged errors are saved to:

/wp-content/debug.log

You can access this file via your file manager or FTP client to review error messages.


Important Notes

  • Disable debug mode on live sites once troubleshooting is complete to avoid exposing sensitive data.

  • Use a staging environment for testing themes, plugins, and custom code.

  • Check file permissions if the debug.log file isn’t being created (the wp-content folder must be writable).


Share via
Did you find this article useful?  

Related Articles

Tags

© Softsys Hosting