When I set WP_DEBUG to true in wp-config.php, I get to see all the strict standards and deprecated messages.

I’ve set the error_reporting in my php.ini, ini_set() and error_reporting() to E_ERROR | E_WARNING | E_PARSE. But I still get to see the strict standards messages.

I know the messages can be useful, but they appear in some of the plugins I am using and I am not interested in seeing them. How do I disable them?

2 s
2

Just don’t set WP_DEBUG to TRUE. The error level is set in wp_debug_mode(), which is called in wp-settings.php before any plugins are loaded. If you leave the default values WordPress will set it to:

error_reporting( 
    E_CORE_ERROR | 
    E_CORE_WARNING | 
    E_COMPILE_ERROR | 
    E_ERROR | 
    E_WARNING | 
    E_PARSE | 
    E_USER_ERROR | 
    E_USER_WARNING | 
    E_RECOVERABLE_ERROR 
);

But you should keep strict standard messages on, because in some cases they advance to real errors in later PHP versions, so it is better to fix them early.

Tags:

Leave a Reply

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