Like most things related to WordPress development, the best way to understand WP_DEBUG_LOG is to do a search of the WordPress core codebase. The important bit shows up in wp-includes/load.php: function wp_debug_mode() { if ( WP_DEBUG ) { error_reporting( E_ALL ); if ( WP_DEBUG_DISPLAY ) ini_set( 'display_errors', 1 ); elseif ( null !== WP_DEBUG_DISPLAY ) ini_set( 'display_errors', 0 ); if ( WP_DEBUG_LOG ) { ini_set( 'log_errors', 1 ); ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' ); } } else { error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); } if ( defined( 'XMLRPC_REQUEST' ) ) ini_set( 'display_errors', 0 ); } I’ll spare you the line by line detail, but essentially if you set WP_DEBUG to true, set WP_DEBUG_DISPLAY to false, and WP_DEBUG_LOG to true, the effect will be that you will get errors logged to a debug.log file in your wp-content folder and no errors will be displayed in PHP output (i.e. in your browser). To set these constants, you add the following to your wp-config.php: define( 'WP_DEBUG', true ); define( 'WP_DEBUG_DISPLAY', false
Share This

We are using cookies on our website

Please confirm, if you accept our tracking cookies. You can also decline the tracking, so you can continue to visit our website without any data sent to third party services.