WP_DEBUG is a WordPress constant that changes how WordPress handles PHP errors. By default, WordPress suppresses many errors, warnings, and notices so visitors don’t see technical output. When you enable WP_DEBUG, WordPress makes it possible to identify which plugin, theme, or custom code is causing the problem.
How to Enable WP_DEBUG
WP_DEBUG is typically enabled in wp-config.php by setting WP_DEBUG to true.
Once enabled, WordPress begins reporting PHP issues during page loads and admin actions, meaning you can reproduce the problem and often see what failed.
WP_DEBUG is usually paired with two other constants: WP_DEBUG_DISPLAY and WP_DEBUG_LOG.
WP_DEBUG_DISPLAY
This constant controls whether errors are shown directly on the page, provided WP_DEBUG is also enabled. On a production site, displaying errors publicly can expose:
- server paths
- plugin/theme structure
- other technical details you don’t want visitors to see
For this reason, it is best to disable WP_DEBUG_DISPLAY unless working in a test or staging environment.
WP_DEBUG_LOG
When enabled, WordPress writes errors to a log file (commonly wp-content/debug.log). This is helpful when:
- you don’t want errors displayed on-screen
- you need a history of what occurred during troubleshooting
- errors happen during background processes (cron jobs, AJAX, REST requests)
Most developers enable logging when troubleshooting.
The Dangers of Directly Modifying Debugging Constants
Editing debugging constants directly in wp-config.php works, but it comes with a few risks—especially if you’re troubleshooting quickly under pressure.
- Typos can take your site down. A missing quote, comma, or parenthesis in
wp-config.phpcan trigger a fatal error and lock you out. - It’s easy to leave debugging enabled. Forgetting to disable the debugging constants when you're finished debugging can expose critical information and/or slow your site's performance.
- Settings can conflict or behave unexpectedly. Mixing
WP_DEBUG,WP_DEBUG_LOG, andWP_DEBUG_DISPLAYwithout a clear plan can lead to errors being shown publicly, not logged, or both. - It encourages “quick fixes” on production. Manual edits make it more likely someone will debug directly on a live site, increasing security, privacy, and stability risks.
A Safer Option: Manage WP_DEBUG With WP Debug Toolkit

If you want a faster and safer way to control debugging, use WP Debug Toolkit. It lets you enable WordPress debugging through the WordPress admin instead of editing files manually, and it provides a central place to review issues as they happen. This means you can:
- Toggle debug mode on and off without touching
wp-config.php - Reproduce a problem and immediately see the resulting errors
- Stay organized while debugging without bouncing between FTP, hosting panels, and log files
Additionally, WP Debug Toolkit:
- Provides deep insight into your database performance with low database impact using its database monitor and Query Viewer features
- Helps you identify slow plugins and queries
- Lets you automatically monitor your site and send email alerts when needed
- Has a crash recovery system that lets you identify and disable the offending component so that you can log back into WordPress Admin to provide a permanent fix
Final Thoughts
WP_DEBUG is one of the most important tools for diagnosing WordPress problems. It doesn’t “fix” anything on its own—it simply makes WordPress tell you what’s wrong.
If you’re troubleshooting errors, enable WP_DEBUG, reproduce the issue, and follow the message to the source. If you want to do this more conveniently, with less risk, and a more powerful debugging toolset, WP Debug Toolkit can make the entire debugging workflow much easier to manage.
For a complete list of debugging plugins, see the 7 Best WordPress Debug Plugins.

