Using WP-Config.php to control error reporting in WordPress
Are you seeing PHP errors or warnings on the front end of your WordPress website? Here is a very simple method for turning that off. First you need to find your ‘wp-config.php’ file. We typically login via SFTP to handle this, but there are plugins that will allow you to modify your core files. Within your ‘wp-config.php’ file search for the following line of code:
This line may already be set to false, in which case it would look like this:
Either way, to completely disable error reporting from your WordPress website, replace the above line of code with these four lines:
ini_set('display_errors','Off'); ini_set('error_reporting', E_ALL ); define('WP_DEBUG', false); define('WP_DEBUG_DISPLAY', false);
Save the file and check the front-end of your website. You should no longer be seeing any PHP errors or warnings. If you would like to turn error reporting back on, replace the above four lines of code with these two lines of code:
define('WP_DEBUG', true); define('WP_DEBUG_DISPLAY', true);
Don’t forget to save the file and check the front-end to ensure your changes are functioning as expected.