Debugging is the important part of any programming languages. By debugging you will find out the errors and warnings in your code and you have chance to fixed that. In today’s tutorial i will explain how to enable debugging in WordPress websites.
To enable the debugging in your WordPress website, go to the root directory and open wp-config.php file. In wp-config.php file find
define( 'WP_DEBUG', false ); and replace the with this code
define( 'WP_DEBUG', true );.
Note. Don’t use the true and false values in single or double comma because they are Boolean (true/false) values.
Copy paste below code in your
wp-config.php for enable debugging in your WordPress website. In the below I have also added the
define( 'SCRIPT_DEBUG', true ); to enable errors in the versions of core JS and CSS files (If you have made changes in the core JS&CSS files).
// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );
There are several WordPress plugin to enable debugging in your websites. Below is the some of example:
2) Debug Bar