How to Hide Fatal Error in WordPress

Solution:1

Try inserting this in your index.php

error_reporting(0);
ini_set('display_errors', 0);

or this in .htaccess

# supress php errors
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_value docref_root 0
php_value docref_ext 0

or just fix them 🙂

Solution:2

It is not a good thing to hide errors. You should fix it. This error is not related to WordPress, it’s a PHP error.

You have two options:

  • disable the error reporting in php settings (file php.ini on the server) and put: “display_errors” to “off”
  • or add a .htaccess file to your wordpress directory (or modify it if it already exists). You should add those lines in it:php_flag display_errors offphp_flag html_errors off

Please for the second solution you should check if the .htaccess is in override mode (so you need an access to the server configuration files.