Turn off WP_DEBUG on a live/production WordPress site

It is generally a very good idea to turn off WP_DEBUG on a live/production WordPress site.

The official WordPress documentation and almost every best-practice guide strongly recommend keeping WP_DEBUG set to false on production sites. Here's why, along with the important nuances:

Main Reasons to Turn It Off in Production

Recommended Production Settings (in wp-config.php)

PHP
 
define( 'WP_DEBUG',         false );
// These two are optional but good hygiene
define( 'WP_DEBUG_DISPLAY', false );    // even if WP_DEBUG is somehow true
@ini_set( 'display_errors', 0 );
 
 

Better Alternative for Production: Logging Without Displaying

If you still want to catch errors on a live site (very sensible for monitoring), use this combo instead:

PHP
 
define( 'WP_DEBUG',         true  );     // enables the debug system
define( 'WP_DEBUG_LOG',     true  );     // writes to wp-content/debug.log
define( 'WP_DEBUG_DISPLAY', false );     // VERY IMPORTANT — no on-screen output
@ini_set( 'display_errors', 0 );
 
 

Many managed WordPress hosts do exactly this by default log silently, rotate logs, and protect the log file from public access.

Quick Summary Table

 
 
Environment WP_DEBUG WP_DEBUG_DISPLAY WP_DEBUG_LOG Typical Use Case
Local dev true true optional See everything immediately
Staging true false true Test safely, capture logs
Production false false optional* Security + clean visitor experience
Production (monitored) true false true Catch errors without showing them
 

Bottom line for most people running live sites: yes turn WP_DEBUG off (set it to false) unless you're actively troubleshooting something right now, and even then, only do it temporarily or behind an IP restriction.

If your site is already live and showing weird warnings/notices, that's usually a sign WP_DEBUG (or PHP's display_errors) is on.