How to Turn Off PHP Errors in WordPress

Displaying PHP errors can make your website appear unprofessional to visitors.

Typically, PHP errors are warnings and notices that do not impede the loading of your website.

These errors serve as tools to assist WordPress developers in debugging code issues.

Nevertheless, to avoid alarming visitors, it is advisable to conceal these errors on production websites.

Let us examine how to promptly eliminate the display of these errors on your website.

To turn off PHP error notices, download and open your wp-config file and look for:

define('WP_DEBUG', true);

It is also possible, that this line is already set to false. In that case, you’ll see the following code:

define('WP_DEBUG', false);

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);

Save the changes and upload your wp-config.php file back to your server.

If you now visit your website all PHP errors, notices, and warnings should will not longer be displayed.

WordPress Maintenance from £30.00/month

Experience unparalleled WordPress support and maintenance with our exceptional service plans. Entrust us with all your WordPress needs, guaranteeing the seamless operation and upkeep of your website.

Get Started