Turn Off Plugin Errors

Put in wpconfig.php


ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);


Put in theme functions.php to turn off admin plugin error notice.

 

function fix_errors($errno, $errstr, $errfile, $errline, $errcontext) {
    if (defined('E_STRICT') && $errno==E_STRICT) {
        return;
    }

    $error_file = str_replace('\\', '/', $errfile);
    $content_dir = str_replace('\\', '/', WP_CONTENT_DIR . '/themes');

    if (strpos($error_file, $content_dir) === false) {
        return true;
    }
    return false;
}
set_error_handler('fix_errors');

 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article