View Categories

How To Enable The WordPress Error Logs

1. Access the wp-config.php file by using an FTP client or the File Manager located in your hosting control panel.

2. Search for define( ‘WP_DEBUG’, false ); and enable the debug by changing false to true.

3. Add or update the following lines in your wp-config.php file just after the WP_DEBUG line to enable error logging and direct the logs to a file:

  • define( ‘WP_DEBUG_LOG’, true );: Enables logging of errors to a file located at /wp-content/debug.log.
  • define( ‘WP_DEBUG_DISPLAY’, false );: Prevents errors from being displayed directly on the site, which is recommended for production environments.
  • @ini_set( ‘display_errors’, 0 );: Suppresses PHP errors from being shown on the site.

4. Save and upload the modified wp-config.php file back to your server.

5. Access the Log File which will be located in the /wp-content/ directory as debug.log.

6. After troubleshooting, remember to turn off debugging by setting WP_DEBUG back to false and removing the other two items added.