How to hide Php errors and warnings displayed on WordPress website.
PHP Errors and warnings can be turned off in several ways:
- From cPanel
- From WordPress configuration file
- From .htaccess
- From the PHP file of the specific page
Option 1 – If you are using WordPress
If you are using WordPress, in the File Manager open your public_html/wp-config.php file. Check if it has one of these lines:
define('WP_DEBUG', true);
define('WP_DEBUG', false);
If one of them is present, remove the line and Add the following code:
ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);
That’s it, now PHP errors will not be displayed on your WordPress website 😊
Opotion 2 – .htaccess and PHP files
In your public_html/.htaccess file (create it, if it’s missing in public_html) add this line:
php_flag display_errors off
After this PHP errors will not be displayed on the website.
Option 3 – .php files code
If you want to hide PHP errors from a single session/page of your website, and you know for which PHP page you wish to disable errors display, just add this line to that page’s file:
error_reporting(0);
NOTES:
Read more >>>> 8 Best Live Streaming Software
Please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Facebook.

Am an experienced website developer with 3 years in building WordPress, Joomla, e-commerce and WIX websites.
I have great skills in html,css, JavaScript,MySQL,C++ and data base management.