WordPress provides a debug tool to help debug an error on a website.
Enabling debug mode will display information on a live website which is visible to visitors. If you are debugging a live website, we recommend creating a debug log file instead of enabling debug mode.
To enable WordPress debug mode:
define('WP_DEBUG',true);
This will enable WordPress debug mode, to allow you to see a greater level of detail on any errors. It sets PHP errors to E_ALL which includes all errors, warnings, notices and deprecated errors, not all of which are necessarily relevant to a broken site but should be taken in context.
To enable and view the WordPress debug log file:
This will enable the debug log file, and the default log file location will be public_html/wp-content/debug.log This will disable displaying the debug information on the front end. Edit the wp-config.php file and add the following lines to the end:-
define('WP_DEBUG_DISPLAY',false);
define('WP_DEBUG_LOG',true);