This article explains how to enable and locate error logs in WordPress for troubleshooting purposes on cPanel-based hosting. This article applies to all supported WordPress versions.
⚠️ Always disable debug mode after troubleshooting is complete.
Prerequisites
Access to cPanel
Ensure PHP error logging is enabled in cPanel
Completion of the task: 10 minutes
Expertise: beginner
How to do?
Open File Manager or connect via FTP
Edit the file wp-config.php
Add or update the following lines:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);Save the file.
Log File Location
/wp-content/debug.log
If the file does not exist, WordPress will create it automatically.
Disable Debug Mode
After troubleshooting, update the wp-config.php file to disable debug mode.
define ('WP_DEBUG', false);
Common Issues
Blank page: Check PHP fatal errors in debug.log
No log file: Verify folder permissions ( wp-content must be 755 )
