Skip to content

Instantly share code, notes, and snippets.

@Pebblo Pebblo/example.php
Last active Sep 1, 2017

What would you like to do?
Snippet to enable WP_DEBUG but log the errors rather than display them on the page.
<?php //Do not include the opening PHP tag
//This code enabled WP Debug but disables display_errors so they are not shown on the page.
//Any errors thrown on your site will be stored within a debug.log file within /wp-content/
define('WP_DEBUG', true);
if ( WP_DEBUG ) {
@error_reporting( E_ALL );
@ini_set( 'log_errors', true );
@ini_set( 'log_errors_max_len', '0' );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false);
//define( 'CONCATENATE_SCRIPTS', false );
//define( 'SAVEQUERIES', true );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.