PHP warnings and notices help developers debug issues with their code. However, it looks extremely unprofessional when they are visible to all your website visitors.
In this article, we will show you how to easily turn off PHP errors in WordPress.
Turning off PHP Errors in WordPress
The above code is simple and works for most WordPress websites.
But for some reason, some websites still display the error, this happens due to the PHP settings in your Hosting.
But you don’t need to worry, as I won’t suggest you go and edit the PHP settings if you don’t know what you are doing.
So, If your Error is still displayed then copy the below code and paste it into your config.php
This code will turn off all your PHP errors in your WordPress from both ends( backend and frontend).
Turning on PHP Errors in WordPress
If you want to log the errors in a file and will start displaying PHP errors, warnings, and notices again.