Disable PHP Errors
PHP warnings and notices help builders debug troubles with their code. but it seems extremely unprofessional while they may be seen to all of your website visitors. In this article, we are able to show you how to without difficulty flip off PHP mistakes in WordPress.
Why Should Turn off PHP Errors in WordPress?
occasionally the WordPress errors log file will create huge headache for a few users since it creates huge file in a few instances. it’s going to once in a while have an effect on the hosting too when you have most effective less area for your server. in order to avoid logging of blunders
Turning off PHP Errors in WordPress
For this part, you will need to edit the wp-config.php file.
Go to public_html directory and find wp-config.php file.
define(
'WP_DEBUG'
, true);
It is also possible, that this line is already set to false. In that case, you’ll see the following code:
define(
'WP_DEBUG'
, false);
In either case, you need to replace this line with the following code:
ini_set
(
'display_errors'
,
'Off'
);
ini_set
(
'error_reporting'
, E_ALL );
define(
'WP_DEBUG'
, false);
define(
'WP_DEBUG_DISPLAY'
, false);
Save the changes.
Turning on PHP Errors in WordPress
If you are working on a local server or staging area, then you should turn on error reporting.
define(
'WP_DEBUG'
, true);
define(
'WP_DEBUG_DISPLAY'
, true);
This code will allow WordPress to start displaying PHP errors, warnings, and notices again.
Thanks for reading….