WP Debug Log

WP Debug Log

WP DEBUG is a permanent global variable in PHP that can be used to activate the “debug” mode in WordPress. It is assumed to be false by default, but on development copies of WordPress, it is usually set to true in the wp-config.php file.

Enable debugging:

define( 'WP_DEBUG', true );

Disable debugging:

define( 'WP_DEBUG', false );

WP_DEBUG_LOG and WP_DEBUG_DISPLAY

WP DEBUG LOG and WP DEBUG DISPLAY are PHP constants that extend WP DEBUG and can be used to debug WordPress as well.

WP_DEBUG_LOG

WP DEBUG LOG is a plugin that works with WP DEBUG to save all errors to a debug.log log file in the /wp-content/ directory. This is important if you wish to review all notices later or if you need to see notices that were generated off-screen (for example, during an AJAX request or a wp-cron run).

define( 'WP_DEBUG_LOG', true );

WP_DEBUG_DISPLAY

WP DEBUG DISPLAY is a companion to WP DEBUG that determines whether or not debug messages are displayed within the HTML of pages. The default value is ‘true,’ which displays errors and warnings as they occur. If you set this to false, all mistakes will be hidden. This should be used in conjunction with WP DEBUG LOG to allow for subsequent analysis of failures.

define( 'WP_DEBUG_DISPLAY', false );

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

all-aws
Golam Mostafa
Written by

Golam Mostafa

Golam Mostafa is a WordPress aficionado with a good sense of cinema. He enjoys reading books and playing football in his spare time.

Table of Content

Table of Contents