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](https://www.361sale.com/wp-content/uploads/2024/08/2024082106354961.png)
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](https://www.361sale.com/wp-content/uploads/2024/08/2024082106360388.png)
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](https://www.361sale.com/wp-content/uploads/2024/08/2024082106264736.png)
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](https://www.361sale.com/wp-content/uploads/2024/08/2024082106293366.png)
This line of code will allow WordPress to start displaying PHP errors, warnings and notifications again.
Link to this article:https://www.361sale.com/en/17209The article is copyrighted and must be reproduced with attribution.






















![Emoji[wozuimei]-Photonflux.com | Professional WordPress repair service, worldwide, rapid response](https://www.361sale.com/wp-content/themes/zibll/img/smilies/wozuimei.gif)
![Emoticon[baoquan] - Photon Wave Network | Professional WordPress Repair Services, Worldwide Coverage, Rapid Response](https://www.361sale.com/wp-content/themes/zibll/img/smilies/baoquan.gif)

No comments