PAUL BUNYAN
wp-config debug settings generator
Pick what you want to do and copy the exact define() lines for wp-config.php. Log errors quietly on a live site, show them on staging, look for slow queries, or turn debugging off again, without leaving errors on screen for your visitors.

Processed in your browser, never uploaded. The code is built on this page. Nothing you type is sent anywhere.
// Debug settings: log errors quietly on a live site.
// Generated by the Diamond Sierra wp-config debug settings generator.
// Turn on WordPress debug mode so PHP errors, warnings and notices are recorded.
define( 'WP_DEBUG', true );
// Write errors to a file outside the public web folder.
define( 'WP_DEBUG_LOG', '/home/username/logs/wp-debug.log' );
// Never show errors to visitors.
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
// Use the normal, minified core CSS and JavaScript.
define( 'SCRIPT_DEBUG', false );
Where to paste it
- Download a copy of wp-config.php first, so you can put it back.
- Delete any define() lines already in the file for WP_DEBUG, WP_DEBUG_LOG, WP_DEBUG_DISPLAY, SCRIPT_DEBUG or SAVEQUERIES. Defining one twice causes a warning and the first value wins.
-
Paste the lines above this line:
/* That's all, stop editing! Happy publishing. */ - Save, load a page, and check that the log file appears where you expected.
Is your debug.log public? How to check, and how big it can get →
What each setting does
WP_DEBUGturns WordPress debug mode on, so PHP errors, warnings and notices are reported.WP_DEBUG_LOGwrites them to a file:truemeanswp-content/debug.log; a path (WordPress 5.1 and later) means that file.WP_DEBUG_DISPLAYdecides whether errors are printed on the page. Keep itfalseon a live site, together with@ini_set( 'display_errors', 0 ).SCRIPT_DEBUGloads the full, unminified core CSS and JavaScript.SAVEQUERIESkeeps every database query, its time and its caller in$wpdb->queries. It costs memory and time on every request, so use it briefly.
Why the log belongs outside the web folder
On most servers anyone who types /wp-content/debug.log after your domain can download the default log, with your server paths and sometimes customer email addresses. Pointing WP_DEBUG_LOG at a folder above public_html keeps it private. How to check whether your debug.log is public.
Got a log? Analyze it in your browser · WordPress debug mode guide · All free debugging tools
