Don't get panic if you see PHP warnings or notices on your site. However, they are crucial for understanding the bone of contention when something unexpected is happening or not working properly on your website.

So, In case you want to hide them, please try the below workaround.

Hiding PHP Errors On WordPress site

  1. Set WP_DEBUG to false in your wp-config.php file.

    define('WP_DEBUG', false);

  2. However, the problem is that due to cheap shared hosts (that force to display PHP warnings) sometimes the above does not work. In that case, replace the above code with the below one.

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

This way you can easily hide the PHP Errors on your WordPress site.

Did this answer your question?