WordPress Debug Constants Explained

WordPress has a handful of PHP constants that control how errors are reported. They all live in your /wp-config.php file, and most WordPress developers never touch them. That’s usually fine until something breaks and you have no idea why.
Here’s what each one does, when to use it, and a common mistake with WP_DEBUG_LOG that could be exposing your error logs to the entire internet.
The official docs are over at WordPress.org’s Advanced Administration Handbook if you want the full reference.
WP_DEBUG
This is the main switch. Set it to true and WordPress will show PHP errors, notices, and warnings on screen.
define( 'WP_DEBUG', true );Leave this on in development, turn it off in production. Simple.
WP_DEBUG_LOG
Instead of printing errors to the screen, this writes them to a log file. Useful for production sites where you don’t want visitors seeing PHP warnings.
define( 'WP_DEBUG_LOG', true );Here’s the catch: this creates a file at /wp-content/debug.log which, depending on your server config, is publicly accessible. Worse, Google has already indexed thousands of them. Gulp.

Instead of passing true, pass a custom filename:
define( 'WP_DEBUG_LOG', 'myOwnRandomFileName_as8f6safsif.log' );Now nobody can guess the URL.
WP_DEBUG_DISPLAY
Controls whether errors show on screen. Set to false on live sites so errors get logged but visitors don’t see them.
define( 'WP_DEBUG_DISPLAY', false );SCRIPT_DEBUG
Forces WordPress to load the full, unminified versions of its CSS and JS files instead of the minified ones. Handy when you’re debugging front-end issues and need to actually read the source.
define( 'SCRIPT_DEBUG', true );SAVEQUERIES
Stores every database query in $wpdb->queries so you can inspect them. Good for tracking down slow queries, but leave it off in production because it adds overhead.
define( 'SAVEQUERIES', true );Checking these across all your sites with mySites.guru
Manually checking wp-config.php on every site gets old fast. The mySites.guru snapshot reads your WordPress config and flags anything that doesn’t match best practice. Most settings have one-click toggles so you can fix them without editing files. The same one-click approach works for other WordPress configuration checks, like removing the WordPress logo from the admin bar.

You can also view any single constant across all your connected sites at once using the Ultimate Toolset. Click through any snapshot tool to see that value on every site in one view.

Need someone to fix it for you?
If debugging isn’t your thing, or you’d rather not deal with it, we offer set-fee site fixes at fix.mysites.guru. No hourly billing, no surprises.
Try mySites.guru free for a month
We haven’t raised our prices since 2012. But if you want to see the toolset for yourself first, you can use mySites.guru free for a whole month.




