Prevent WordPress showing notice errors

When you are working with an older site it may be necessary to prevent notice level errors from appearing in the error log so that you aren’t swamped with too many messages.

Adding code to wp-config.php doesn’t work because WordPress itself tries to set the error level.

Instead create a ‘must use’ plugin and add the following:

error_reporting(E_ALL & ~E_NOTICE);

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.