Title: Supressing WordPress Error Page
Last modified: August 18, 2016

---

# Supressing WordPress Error Page

 *  [marky](https://wordpress.org/support/users/marky/)
 * (@marky)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/supressing-wordpress-error-page/)
 * Sometimes, unfortunately, stuff happens and the database server goes down or 
   is slow to respond and WordPress generates an error page letting me know.
 * This in itself isn’t that bad, but I do consider it a (minor) security threat
   to have WordPress report the URL of my SQL server to users when it’s down. Is
   there any way to suppress this?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [niziol](https://wordpress.org/support/users/niziol/)
 * (@niziol)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/supressing-wordpress-error-page/#post-375258)
 * I use the following code in my .htaccess file to suppress the error messages 
   and log those errors to the server log instead:
 *  php_flag log_errors on
    php_flag display_errors off
 * The only downside is that the visitor will get a blank white page if there is
   a fatal error. I believe your host does need to allow .htaccess settings to over-
   ride the php.ini values for this to work, you can also add add/change similar
   values in the ini file to achieve the same results.
 * Good luck,
    Michael.
 *  Thread Starter [marky](https://wordpress.org/support/users/marky/)
 * (@marky)
 * [20 years, 1 month ago](https://wordpress.org/support/topic/supressing-wordpress-error-page/#post-375264)
 * Thanks for the prompt reply, Michael! I’ll give it a shot. 🙂
 * Edit: Hmm… I still seem to be getting the WordPress error. The message is actually
   being served by WordPress; that is, it’s not really a PHP error message.
 *  [sam_a](https://wordpress.org/support/users/sam_a/)
 * (@sam_a)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/supressing-wordpress-error-page/#post-375663)
 * > Is there any way to suppress this?
 * In `/wp-includes/wp-db.php` on line 18, change
 * `var $show_errors = true;` to
    `var $show_errors = false;`
 * It looks like that change will make WordPress die with an empty page instead 
   of the error message (haven’t tried it).

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Supressing WordPress Error Page’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [sam_a](https://wordpress.org/support/users/sam_a/)
 * Last activity: [19 years, 7 months ago](https://wordpress.org/support/topic/supressing-wordpress-error-page/#post-375663)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
