How to enable debugging in WordPress?

By default, WordPress debugging is turned off, so to enable it, open wp-config.php (tip: take a backup copy of this file that we can revert to later if needed) in the root of our WordPress installation and look for this line:

define('WP_DEBUG', false);

Replace that line with the following:-

// Turns WordPress debugging on
define('WP_DEBUG', true);

// Tells WordPress to log everything to the /wp-content/debug.log
file
define('WP_DEBUG_LOG', true);

// Doesn't force the PHP 'display_errors' variable to be on
define('WP_DEBUG_DISPLAY', false);

// Hides errors from being displayed on-screen
@ini_set('display_errors', 0);

With those lines added to our wp-config.php file, debugging is fully
enabled.

Total Page Visits: 1823 - Today Page Visits: 2

Leave a Reply