When your WordPress site shows a blank page, unexpected errors, or features stop working after an update, turning on WordPress Debug Mode is one of the fastest ways to find out what’s wrong.
In this guide, you’ll learn how to enable WordPress debug, log errors properly, and safely disable it after troubleshooting.
✅ What is WordPress Debug Mode?
WordPress Debug Mode is a built-in feature that helps developers and site owners detect PHP errors, warnings, and notices on their website.
It is mainly used to:
- Identify plugin or theme issues
- Diagnose “white screen of death” problems
- Find PHP warnings and fatal errors
- Monitor deprecated functions and code problems
⚠️ Before You Enable Debugging (Important)
Debug mode can expose sensitive error messages, especially if you display them on the frontend.
Best practice:
✅ Use debug mode only on staging or test sites, not on a live production website.
If you must enable it on a live site, make sure errors are written to a log file (not displayed).
✅ How to Enable WordPress Debug Mode
To enable WordPress debug mode, you need to edit the wp-config.php file.
Step 1: Access Your WordPress Files
You can do this using either:
- cPanel → File Manager
- FTP client (FileZilla, Cyberduck, etc.)
- Hosting dashboard file manager
Step 2: Locate wp-config.php
Go to the WordPress root folder (usually public_html/) and find:
✅ wp-config.php
Step 3: Edit the File and Add Debug Code
Open wp-config.php and search for:
/* That's all, stop editing! Happy publishing. */
Just above that line, add the following:
define('WP_DEBUG', true);
That’s it — debugging is now enabled.
✅ Enable Debug Logging (Recommended)
Instead of displaying errors on the screen, you can log them into a file.
Add this to your wp-config.php:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
Where is the debug log saved?
WordPress saves it here:
📌 /wp-content/debug.log
You can open this file anytime to view errors.
✅ Enable Script Debug (Optional)
WordPress uses minimized (compressed) CSS and JS files. Script debug forces WordPress to load the full versions, which can help during troubleshooting.
Add this:
define('SCRIPT_DEBUG', true);
✅ Full Recommended Debug Configuration
Here’s a safe and popular debug setup:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
define('SCRIPT_DEBUG', true);
This setup:
✅ Logs errors
✅ Hides them from visitors
✅ Helps track script issues
✅ How to Disable WordPress Debug Mode
Once you’re done troubleshooting, disable debugging to keep your site secure and clean.
Edit wp-config.php again and change:
define('WP_DEBUG', true);
To:
define('WP_DEBUG', false);
Or remove the debug lines completely.
🔥 Common Problems You Can Fix Using Debug Mode
Debug mode can help reveal problems like:
- Plugin conflicts
- Theme function errors
- PHP fatal errors
- Deprecated PHP functions
- Memory limit issues
- Blank white screen
If you see errors like:
Fatal errorWarning: Cannot modify header informationParse errorUndefined function
…it’s usually linked to a faulty plugin, theme, or custom code.
✅ Bonus Tip: Use a Staging Site
If you’re frequently debugging issues, consider using a staging environment:
- Test plugins and updates safely
- Debug without affecting visitors
- Reduce risk of downtime
Many hosts like SiteGround, Bluehost, and WP Engine provide staging tools.
Final Thoughts
Knowing how to enable WordPress debug is an essential troubleshooting skill. Whether you’re fixing a broken plugin, diagnosing theme issues, or resolving a blank screen, debug mode gives you clear insight into what’s happening behind the scenes.
✅ Just remember: always disable debug mode after fixing the issue, especially on live websites.

Leave a Reply