Forums

Disable error reporting in WordPress (1 post)

  1. Earthman Web & Media
    Member
    Posted 5 months ago #

    I have seen a few posts in these forums looking for a way to disable PHP notices or to disable php warnings showing up in WordPress.

    The other posts suggested putting the following at the *top* of wp-config.php file:

    error_reporting(0);

    This does not work, however, because when that file calls wp-settings.php at the bottom, the error reporting is overidden by WordPress' own settings.

    In order for the line above to work, it most come after the call to wp-settings.php - for example:

    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
    
    error_reporting(0);

    Just remember, if you want to enable WP_DEBUG, you will have to comment out this line for you to see debugging errors.

    Hope this helps!

Reply

You must log in to post.

About this Topic

  • RSS feed for this topic
  • Started 5 months ago by Earthman Web & Media
  • This topic is not resolved
  • WordPress version: 3.5