Skip to main content
Error logging helps diagnose connection issues and plugin conflicts by recording PHP errors and warnings to a log file. Enable this on your MainWP Dashboard when troubleshooting problems.

What You’ll Learn

  • Enable WordPress debug mode
  • Configure error logging to a file
  • Access and read the debug log

Prerequisites

  • FTP or file manager access to your Dashboard site
  • Ability to edit wp-config.php

Enable Error Logging

1

Access wp-config.php

Connect to your MainWP Dashboard site via FTP or your hosting file manager and open wp-config.php.
2

Add debug constants

Insert the following code before the line /* That's all, stop editing! Happy blogging. */:
// 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 );
3

Save the file

Save your changes to wp-config.php.

What Each Setting Does

ConstantPurpose
WP_DEBUGEnables debug mode, which enables error tracking
WP_DEBUG_LOGWrites errors to /wp-content/debug.log
WP_DEBUG_DISPLAYWhen false, hides errors from visitors while still logging them

Access the Debug Log

Find your error log at:
/wp-content/debug.log
You can access this file via:
  • FTP or SFTP
  • Hosting file manager
  • SSH command: tail -f /path/to/wp-content/debug.log

Disable Error Logging

When you’ve finished troubleshooting, disable debug mode to improve performance and security:
define( 'WP_DEBUG', false );
Or remove the debug constants entirely.
Do not leave debug mode enabled on production sites. The debug log may contain sensitive information and debug mode can affect performance.

Self-Check Checklist

  • Debug constants are added to wp-config.php
  • Constants are placed before the “stop editing” line
  • debug.log file is being created in /wp-content/
  • Errors are being logged when issues occur