Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to write a if statement into the wp-config.php to only enable define('WP_DEBUG', true); if it's not the main site in a WordPress Multisite install. I just don't know how much of the WordPress codex functions I can call from the config file.

Was thinking

if ( is_main_site($blog_id) ) {
  define('WP_DEBUG', false);
else {
 define('WP_DEBUG', true);

But I figured I would pick the communities brain on this one.

share|improve this question

1 Answer 1

Your best bet would be to match $_SERVER['HTTP_HOST'] variable against desired host. Unfortunately wordpress init WP_DEBUG constant before multisite functions are loaded.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.