Skip to content
Diamond Sierra

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.

The Fix first screen: problems ranked by cost, each with its PB code and what to do

Processed in your browser, never uploaded. The code is built on this page. Nothing you type is sent anywhere.

1. What do you want to do?

Your hosting file manager shows the folder above public_html, usually /home/username/. Make a logs folder there and use its full path.

Your wp-config.php lines
// 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

    1. Download a copy of wp-config.php first, so you can put it back.
    2. 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.
    3. Paste the lines above this line: /* That's all, stop editing! Happy publishing. */
    4. 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_DEBUG turns WordPress debug mode on, so PHP errors, warnings and notices are reported.
    • WP_DEBUG_LOG writes them to a file: true means wp-content/debug.log; a path (WordPress 5.1 and later) means that file.
    • WP_DEBUG_DISPLAY decides whether errors are printed on the page. Keep it false on a live site, together with @ini_set( 'display_errors', 0 ).
    • SCRIPT_DEBUG loads the full, unminified core CSS and JavaScript.
    • SAVEQUERIES keeps 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

    Install it. Load a few pages.
    Open Fix first.

    Get it free on WordPress.org