WordPress Debug Errors Showing on Website
Overview
WordPress debug mode is a development tool that outputs PHP notices, warnings, and errors directly to the screen. When WP_DEBUG is enabled on a live site, raw error messages and code references appear in place of normal page content, or alongside it — visible to every visitor.
Common Causes
WP_DEBUGset totrueinwp-config.phpon a production siteWP_DEBUG_DISPLAYnot explicitly set tofalse- a plugin or theme activating debug mode as a side effect
- a staging environment migrated to production with debug settings intact
- a developer enabling debug mode to troubleshoot an issue and not reverting the change
How the Problem Appears
- PHP notices, warnings, or deprecated function messages printed on the page
- error messages containing file paths and line numbers visible in the browser
- layout partially broken by injected error output
- white screen with only error text
- debug log entries appearing in page source
How It Is Diagnosed
- reviewing
wp-config.phpforWP_DEBUG,WP_DEBUG_LOG, andWP_DEBUG_DISPLAYconstants - checking whether errors appear for all users or only logged-in administrators
- inspecting the page source for hidden error output
- reviewing the
wp-content/debug.logfile for logged errors
Typical Fix
- set
WP_DEBUGtofalseinwp-config.php - set
WP_DEBUG_DISPLAYtofalseto suppress screen output - optionally set
WP_DEBUG_LOGtotrueto redirect errors to a log file instead - if the underlying PHP errors are legitimate, address the deprecated functions or plugin issues generating them
The correct production configuration in wp-config.php:
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_LOG', false );
define( 'WP_DEBUG_DISPLAY', false );
Related Technical Issues
Technical Website Support
If debug errors are appearing on your live website, they should be resolved immediately — they expose internal file structure to visitors and indicate unresolved code issues.