This will allow WordPress to display errors to the screen as they occur. Please note that this may reveal important information to users and can pose a security risk. It is advised to see one of the options below capture errors more safetly.
Logging Errors to a File
It is recommended to log your errors to a file instead of displaying them on the screen. WordPress by default will display errors to the screen when WP_DEBUG is enabled. This section will cover both hiding these errors and turning on file logging.
To turn off the display of errors, you must add the WP_DEBUG_DISPLAY flag to your wp-config.php file. Below the WP_DEBUG line found above, add in the following line:
Now that we have debugging turned on and the display of errors off, we will need to enable logging to a file so we can retrieve the errors safely. By default, your error log will be found in /wp-content/debug.log. In your wp-config.php, add the following line below the two added above:
Example wp-config.php for Debugging
This is an example wp-config.php used for debugging. The display of errors are set to false and file logging is enabled.
// Enables Debugging
// Enable Debug logging to the /wp-content/debug.log file
// Disable display of errors and warnings