WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Wordpress has two functions related to SQL queries and their errors as mentioned in What Is The Difference Between suppress_errors() And hide_errors() in $wpdb?

From what I've read setting WP_DEBUG to false in wp-config.php will set hide_errors() so that mySql errors aren't show - but if the site can't connect to the database you'll still error:

WordPress database error: [MySQL server has gone away]`

Without modifying the core file wp-includes/wp-db.php and setting the line ~69 to
var $suppress_errors = true; (which is what I've done for now), how can I set suppress_errors to false without modifying the core?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.