How to turn off Php errors in WordPress

When you use WordPress, you have ever seen PHP error once, it’s common error from sever, code, …

I received many questions about how to hide/fix the PHP errors so today, i will make a tutorial to hide error. About fixing, depend on every error so i make a guide for a error clearly

Why you should turn off PHP errors in WordPress

PHP errors displays in back-end or front-end,  your customers and you fell uncomfortable when you access the website.  It loos like notice or warning when you load website, it is not from sever, network, it’s from code of theme.

Screenshot_6

If that warning displays in your website, it becomes unprofessional.

How to turn off warning/error

Please open your wp-config.php file, look for the following line:

1
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:

1
define('WP_DEBUG', false);

In either case, you need to replace this line with the following code:

1
2
3
4
ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);

How to turn off warning/error

Please open your wp-config.php file, look for the following line:

define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', true);
That’s all, hopefully this article helped you know how to turn off Php errors in WordPress. If you have any further questions for us, don’t hesitate to put it up in the comments. See you again in orther tutorials!

Leave a Reply

Your email address will not be published. Required fields are marked *