Using WordPress debug logs in production (safely)

wordpresstroubleshootingops

Debug logs can help track down production issues—as long as errors go to a file and not to the screen. This guide shows a safe approach and what to watch.

Safe approach

What to watch

FAQ

How do I enable debug logging without showing errors to users?
In wp-config.php: set WP_DEBUG to true, WP_DEBUG_LOG to true, and WP_DEBUG_DISPLAY to false. Optionally set WP_DEBUG_DISPLAY to false and use a plugin or custom code to avoid logging in production if you prefer.

Where do I look next when the log shows a fatal?
Correlate with Apache error logs and use WordPress 500 triage to confirm whether it’s plugin, theme, or server.