WordPress Reference
< All Topics
Print

How to hide PHP Warnings in WordPress

After I moved one of my sites from the local host MAMP location to the live domain, I started receiving a couple of php warnings for a plugin.

My wp-config.php file already had the line: define(‘WP_DEBUG’, false);
but I received the warnings anyway.

The following resolved the problem for me:

In wp-config.php, replace:

define('WP_DEBUG', false);

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

I found this solution at the following url:

https://aristath.github.io/blog/wp-hide-php-errors

latest Articles

Table of Contents