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.