Home > Featured > Suppress Errors and Warnings in WordPress
Bookmark and Share

Suppress Errors and Warnings in WordPress

Posted on September 23, 2012 | Filed in Featured, Wordpress

Your WordPress install is throwing up errors either because you’re on a new host or your hosting company upgraded PHP.

Before you find the time to do a proper WordPress upgrade you can add the following code as a stop-gap measure, to your wp-config.php to suppress error messages:

@ini_set(‘display_errors’,’Off’);
@ini_set(‘error_reporting’,0);

There is one comment

  1. It seems this doesn’t work anymore since the latest WP updates. I solved the problem by adding this
    error_reporting(0);
    @ini_set(‘display_errors’, 0);
    immediatley the line after the opening php at the beginning of /wp-includes/class-wp-error.php

    Jul 20, 2013

Leave a Reply