How to Log Website Errors in WordPress

Instead of displaying errors on the website, you can log them to a file.

Open wp-config and replace:

define('WP_DEBUG', false);

with:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);

Errors will then be logged to /wp-content/debug.log.

Disable debugging after troubleshooting is complete, as log files can grow large over time.

Was this answer helpful? 0 Users Found This Useful (0 Votes)