Guide

Enable WordPress debug log safely

Turn on WP_DEBUG_LOG without displaying errors publicly so WordPress 500, white screen, plugin, theme, and PHP failures leave evidence.

When to use this guide

Use this when WordPress returns a 500 error, shows a white screen, breaks after a plugin or theme update, or hides the PHP error you need to diagnose.

Safety notes

  • Add debug constants above the line that says to stop editing.
  • Keep WP_DEBUG_DISPLAY off on public sites.
  • Remove or disable temporary debug settings after the incident is understood.
  • Do not paste full debug logs publicly if they include paths, usernames, tokens, or customer data.

Basic steps

Add or update these constants in wp-config.php:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

Then reload the failing page once and check wp-content/debug.log.

Expected result

The site should not display raw PHP errors to visitors. The debug log should capture fatal errors, warnings, plugin paths, theme paths, or missing PHP extensions that point to the next repair.

Review notes

Last reviewed
2026-05-05
Reviewed by
FaultForge Editorial Team, Web operations reviewer
Tested on

Current stable browser behavior, server log workflows, WordPress administration, nginx proxy behavior, and MySQL/MariaDB operational checks.

Sources