How to Turn Off PHP Errors in WordPress

A reader recently left a comment asking "How to Turn Off PHP Errors in WordPress"? During development PHP warnings and notifications can help debug problems in your code. However, if these warnings and notifications are visible to all website visitors, the whole website will look very unprofessional. So, how do we turn off PHP errors in WordPress you?

Why and when should I turn off PHP errors in WordPress?

PHP errors seen on WordPress sites are usually warnings and notifications. These errors are related to theInternal server error,grammatical errormaybefatal errornot the same, PHP errors can prevent the site from loading.

Notifications and warnings are the types of errors that won't prevent WordPress from loading a website.

Image[1] - How to turn off PHP errors in WordPress - Photon Flux | Professional WordPress fixing service, worldwide, fast response

These errors help developers debug code issues. Plugin and theme developers need this information to check compatibility.

However, if no custom theme, plugin or website has been developed, then these errors are to be hidden. Because if they appear on the front end of the website all visitors see them and the website looks very unprofessional.

Image [2] - How to turn off PHP errors in WordPress - Photonwave.com | Professional WordPress repair service, worldwide, fast response

When you see an error like the above on your WordPress website, then contact the theme or plugin developer. They can fix the program to remove the errors. In the meantime, you can close these errors yourself.

Turn off PHP errors in WordPress

For this section, it is necessary to edit the wp-config.php fileThe

In the wp-config.php file, find the following line of code:

define('WP_DEBUG', true);

It is also possible that this line of code has been set to false, in which case the following line of code is seen:

define('WP_DEBUG', false).

In both cases above, you need to replace the code that appears above with these codes below:

Image [3] - How to Turn Off PHP Errors in WordPress - Photonwave.com | Professional WordPress fixing service, worldwide, fast response

Don't forget to save the changes and move the wp-config.php file toupload sth. back to the serviceWare.

It is now possible to refresh your visit to the site and confirm that PHP errors, notifications and warnings have disappeared from the site.

Enabling PHP Errors in WordPress

If you are developing a website on a local server or staging area, if you want to turn on error reporting. In this case, edit the wp-config.php file and replace the previously added code with the following code:

Image [4] - How to Turn Off PHP Errors in WordPress - Photonwave.com | Professional WordPress fixing service, worldwide, quick response

This line of code will allow WordPress to start displaying PHP errors, warnings and notifications again.


Contact Us
Can't read the tutorial? Contact us for a free answer! Free help for personal, small business sites!
Customer Service
Customer Service
Tel: 020-2206-9892
QQ咨询:1025174874
(iii) E-mail: info@361sale.com
Working hours: Monday to Friday, 9:30-18:30, holidays off
© Reprint statement
This article was written by Harry
THE END
If you like it, support it.
kudos0 share (joys, benefits, privileges etc) with others
commentaries sofa-buying

Please log in to post a comment

    No comments