WordPress Debug Mode: How to Use WP_DEBUG

Published April 21, 2026

WordPress Debug Mode Guide

WordPress debug mode surfaces PHP errors, warnings, and notices that are normally hidden. Enabling it is the fastest way to diagnose crashes, blank screens, and unexpected behavior.

Enabling WP_DEBUG

Edit wp-config.php and add before the "That's all, stop editing!" comment:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);    // Write errors to /wp-content/debug.log
define('WP_DEBUG_DISPLAY', false); // Hide errors from visitors
define('SCRIPT_DEBUG', true);    // Use unminified JS/CSS

Reading debug.log

The log file at /wp-content/debug.log shows errors with file paths and line numbers. Each entry follows the format: [date time] PHP Error Type: message in /path/to/file.php on line N. Focus on fatal errors first — they stop execution. Notices and warnings are lower priority.

Error Types

Query Monitor Plugin

For development environments, install Query Monitor. It shows database queries, hooks, PHP errors, HTTP API calls, and memory usage in a toolbar overlay. Essential for performance profiling.

Disabling Debug Mode

Always set WP_DEBUG to false before pushing to production. Showing PHP errors to visitors reveals server paths and code structure — a security risk.

Server-Level Logging

SiteICO's dashboard provides access to PHP error logs and server logs without needing to enable WP_DEBUG, giving you production error visibility without exposing debug output to the public.