You may think it is a mistake to hide them, because if there is a warning or PHP error in your WordPress, would not it be better to show it in order to fix it?
But that would be in an ideal world in which we could always, we even needed to live without mistakes. But the reality is that there are many and of many types the warnings and errors of PHP that a WordPress can show, and they will not always be something vital, urgent to solve .
I am referring to notices of unnecessary functions, compatibility warnings and lots of possible PHP notices that we can get to see in a web created with WordPress .
If you ever encounter warnings or PHP errors that - in reality - do not negatively affect the security or functioning of your website , you can hide them.
Little more to say about the WordPress debug mode, which I already explained in this article about what WP_DEBUG is and how to use it .
But we can use it to hide PHP errors and warnings, at least checking that it is not active, and for that the easiest thing is to add this line to your file wp-config.php:
WHAT IF THEY CONTINUE TO SHOW ERRORS DESPITE HAVING THE DEBUG MODE IN FALSE ?
It can happen, especially in cheap hostings that - by commercial strategy - force the display of PHP errors , to encourage users to acquire superior plans or additional services or go to know.
If this is your case, and despite having falsedebug mode, PHP errors are still displayed, replace the previous line with this one in your wp-config.php:
ini_set('error_reporting', E_ALL );
With these lines should not show any error or warning of PHP in WordPress.
I WOULD NOT DO IT
Mind you, to teach you how to do these things does not mean you should not be aware and responsible with the errors and warnings of PHP, and you should only hide them when you know for sure that you are not hiding an error or warning about a security or programming problem. serious that may compromise your website or those of your clients.
Solved! Go to Solution.