WordPress.org

Ready to get started?Download WordPress

Forums

Disable error reporting in WordPress (2 posts)

  1. Earthman Web & Media
    Member
    Posted 1 year 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!

  2. adamxp12
    Member
    Posted 10 months ago #

    sorry wrong topic

Topic Closed

This topic has been closed to new replies.

About this Topic