Example wp-config.php for Debugging

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
  1. define( 'WP_DEBUG', true ); - This line enables the debugging mode in WordPress, allowing PHP errors, warnings, and notices to be displayed.
  2. define( 'WP_DEBUG_LOG', true ); - This line directs WordPress to log all errors, warnings, and notices to a debug.log file located in the wp-content directory.
  3. define( 'WP_DEBUG_DISPLAY', false ); - This line ensures that errors, warnings, and notices are not displayed on the screen, keeping the site interface clean for visitors.
  4. @ini_set( 'display_errors', 0 ); - This line suppresses PHP errors from being displayed on the screen, further preventing them from interfering with the site's frontend.