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 £20.00/month

Tired of bloated maintenance plans that don’t fit your site? Get expert WordPress support that’s built around you. No lock-ins, no unnecessary extras - just solid, technical care from £20 a month. Choose what you need, skip what you don’t, and keep your site running exactly as it should.

Get Started