How to Turn off PHP Errors in WordPress
If you don’t know how to turn off PHP errors in WordPress then you can follow the article given below. PHP errors that you can see on your WordPress site are usually warning and notices. In this article, we will show you how to easily turn off PHP errors in WordPress.
Why and When you should Turn off PHP Errors in WordPress?
PHP errors that you face on your WordPress site are normal warnings and notices help developers debug issues with their code. These are not the type of internal server error, syntax errors, or fatal errors, which stop your website when it is loading. However, it looks extremely unprofessional when they are visible to all your website visitors.
Notices and warnings are the kinds of errors that do not stop WordPress from loading your website.
The main reason of these errors are help developers debug issues with their code.This information is very useful to plugin and theme developers for checking compatibility and best practices.
These errors should be hidden when you are not developing a theme ,plugin or a custom website.It looks extremely unprofessional if they appear on the front-end of your website all your visitors.
If you face any error like above on your site,then you need to inform the respective theme or plugin developer.They can be release a fix that would make the error remove.Else ,you can also turn these errors off .
Now follow the given steps to easily turn off PHP errors, notices and warning in WordPress.
Turning off PHP Errors in WordPress
In this part,you need to edit the wp-config.php file.
If you notice that this line is already set to false. In that case, you’ll see the following code:
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);
Remember to save your changes and upload your wp-config.php file back to the server.
Now You can visit your website to confirm that the PHP errors, notices, and warnings have disappeared from your website.
Turning on PHP Errors in WordPress
If you are working on a website which is on the local server staging area, then you can turn on error reporting. In that case, you need to edit your wp-config.php file to replace the code you added earlier with the following code:
define('WP_DEBUG', true); define('WP_DEBUG_DISPLAY', true);
This code will allow WordPress to start displaying PHP errors, warnings, and notices again.
We hope this article will help you learn how to turn off php errors in WordPress.