Wordpress-Code-is-Poetry

Suppress error notices using WordPress’s WP_DEBUG

In your `wp-content` folder create a new folder called `mu-plugins` and in that folder create a php file with the error level you want, for example:

1
2
//Turns off notices
error_reporting(E_ALL ^ E_NOTICE);

If you are using PHP 5.5 +, you will get deprecated noticed for WordPress’s mysql_* functions, you can turn them off using:

1
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);

Or for something really robust, which happens to be the case a lot.

1
error_reporting(E_ALL &  ~( E_DEPRECATED | E_USER_DEPRECATED | E_USER_NOTICE | E_STRICT ));

Source: How to remove error notices using WordPress’s WP_DEBUG | ../ wycks

Want to share your thoughts?

Leave a Reply

Your email address will not be published. Required fields are marked *