Hide PHP Warnings and Errors in WordPress

This post teaches you on how to remove those annoying PHP warnings or errors on your WordPress website. It is ok sometimes to have it, but what if they won't go away even after you turn ''debugging'' off?

0
25
wordpress warning
When you can't get rid of the php warnings..

I manage many WordPress websites and sometimes ( it’s like almost never) after an update (theme, plugin, wp..) I get strange errors or warnings at the top of my dashboard, and on the Front-end.

Usually it is nothing to worry about. But the real problem starts when the notifications about the error/warning just don’t want to go away!

In this case scenario you have to edit your WP-CONFIG file.
Put this in it:

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

Save the changes you made and Voila > No more PHP nags.
Enjoy!

(ps. If you already have define('WP_DEBUG', false);
then just replace it with the code I gave you)

LEAVE A REPLY

Please enter your comment!
Please enter your name here