Skip to main content

How to Enable Error Logs - WordPress

Updated over a week ago

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?

  1. Open File Manager or connect via FTP

  2. Edit the file wp-config.php

  3. Add or update the following lines:
    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    define('WP_DEBUG_DISPLAY', false);

  4. 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 )

Did this answer your question?