All Collections
Tutorials
How to Retrieve PHP Error Logs
How to Retrieve PHP Error Logs
Updated over a week ago

There are many instances when your WordPress website is having critical issues. These issues can be due to plugins misconfiguration, errors in custom code, and whatnot.

Error logs allow you to see the details about these errors at your debug.log file in the wp-content directory.

You can write the below code in your wp-config.php file after the line that says "That's all, stop editing!" to log all errors, warnings, and notices. Also, it will hide errors in the frontend pages.

// 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);
Did this answer your question?