Enabling WordPress Debug Mode
Edit wp-config.php:
// Add before "That's all, stop editing!"
// Enable debug mode
define('WP_DEBUG', true);
// Log errors to debug.log file
define('WP_DEBUG_LOG', true);
// Hide errors from display (security)
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);
// Log database queries (optional)
define('SAVEQUERIES', true);
Viewing Debug Logs
Log file location:
/wp-content/debug.log
// View last 50 lines via SSH
tail -n 50 wp-content/debug.log
// View in real-time
tail -f wp-content/debug.log
Plugin-Specific Debug Mode
// Enable plugin debug logging
Settings → Attributes User Access → Advanced
☑️ Enable Debug Logging
// View plugin logs
Users → Attributes User Access → Logs
Common Error Messages
Fatal Error: Call to undefined function
Cause: Missing PHP extension or WordPress function
Fix: Check system requirements, enable required extensions
Warning: Cannot modify header information
Cause: Output before headers sent
Fix: Remove whitespace/echo before wp-config.php opening tag
Notice: Undefined index
Cause: Accessing array key that doesn’t exist
Fix: Usually harmless, can be ignored or reported
Collecting Debug Information
Tools → Site Health → Info
Export information for support ticket:
- WordPress version
- PHP version
- Active plugins
- Theme
- Server environment
Disabling Debug Mode
// After troubleshooting, disable debug
define('WP_DEBUG', false);
define('WP_DEBUG_LOG', false);
// Delete debug.log file
rm wp-content/debug.log