1.2K
Sometimes you need to enable debugging in WordPress to check errors in your plugin or theme code.
After enabling, WordPress debug will log any errors detected on your site. This can be key to finding the source of an issue on your WordPress website.
Follow the steps to enable debugging in WordPress.
- Open wp-config.php from your hosting File Manager.
- Open wp-config.php and locate the line
(
'WP_DEBUG'
,false);
- Replace your code with the following lines of code
// 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 );
- Save wp-config.php file.
- Reproduce the issue.
- You can see that WordPress has creates a debug.log file in wp-content folder. You can see the error details in this file.
Photo by Negative Space from Pexels