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

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

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

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

A step-by-step guide to turning on WordPress debug mode by editing the wp-config.php file using cPanel’s File Manager.

What Is WordPress Debug Mode?

WordPress debug mode helps developers and site administrators troubleshoot issues by displaying PHP errors, warnings, and notices directly on your website or saving them to a debug log file. This mode is essential when fixing plugin conflicts, theme issues, or other errors.

Why Enable Debug Mode?

  • Identify and fix PHP errors and warnings
  • Help debug plugin or theme conflicts
  • Improve site stability and performance
  • Generate debug logs for detailed analysis

Step 1: Log into cPanel

Access your hosting cPanel by visiting https://yourdomain.com/cpanel or through your hosting provider’s dashboard.

Step 2: Open File Manager

Once logged in, locate and open File Manager under the Files section.

Navigate to the root folder of your WordPress installation, typically public_html or a subfolder if installed in a subdirectory.

Step 3: Edit wp-config.php File

  1. Locate the wp-config.php file in the root WordPress directory.
  2. Right-click the file and choose Edit or select the file and click the Edit button from the top menu.
  3. In the editor, look for the line that says:
    define('WP_DEBUG', false);

    or if it doesn’t exist, prepare to add it.

  4. Change the line to enable debug mode by setting it to true:
    define('WP_DEBUG', true);
  5. To log errors to a file instead of showing them on the website, add the following lines below it:
    define('WP_DEBUG_LOG', true);
    define('WP_DEBUG_DISPLAY', false);
    @ini_set('display_errors', 0);
    

    This will save errors to a debug.log file inside the wp-content folder without displaying errors to visitors.

  6. Save the changes and close the editor.

Step 4: Check Debug Logs

If you enabled WP_DEBUG_LOG, navigate to the wp-content folder and open the debug.log file to review error messages and notices generated by WordPress.

Step 5: Disable Debug Mode After Troubleshooting

For security and performance reasons, it’s important to disable debug mode once you have fixed the issues by setting WP_DEBUG back to false:

define('WP_DEBUG', false);

Troubleshooting Tips

  • If you don’t see the wp-config.php file, ensure you are in the correct directory.
  • Make a backup of wp-config.php before editing to avoid accidental site issues.
  • If you encounter permission issues, contact your hosting provider.

Conclusion

Enabling debug mode via cPanel is a powerful way to diagnose and fix WordPress problems. Always remember to turn off debugging after use to keep your site secure and optimized.

Post Your Comment

Build Your Website with HiveRift

From professional business to enterprise, we’ve got you covered!

©2025, Hosting. All Rights Reserved by KhatuShyam Technologies

HiveRift
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.