This tutorial shows how to disable error reporting in WordPress. This is useful and recommended for production sites so that visitors don’t find themselves looking at weird errors that might contain sensitive server information. Fortunately, WordPress makes it easy to enable or disable error reporting. Here are the steps to make it happen..

Disable Error Reporting

To disable error reporting, open up your site’s wp-config.php file and add the following lines, just before the line that says, “That’s all, stop editing! Happy blogging”:

define('WP_DEBUG', false);
define('WP_DEBUG_LOG', false);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);

Once included, that code basically disables WP’s built-in debugging and prevents the display of any errors. Recommended for live/production sites.

Enable Error Reporting

To enable error reporting, repeat the process but use this code instead:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);

Once included, that code basically enables WP’s built-in debugging and also prevents the display of any errors. Recommended for test/development sites.

Resources

More information, and to customize/fine-tune these methods, visit WordPress.org: