Title: Getting the &quot;Cannot modify header information&quot; error
Last modified: August 24, 2016

---

# Getting the "Cannot modify header information" error

 *  Resolved [revlow](https://wordpress.org/support/users/revlow/)
 * (@revlow)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/getting-the-cannot-modify-header-information-error/)
 * Hi. I am getting the same error that Monoloid did a week ago. I am using the 
   Spacious theme: [http://demo.themegrill.com/spacious/](http://demo.themegrill.com/spacious/).
   I tried to follow his advice, but it’s still not working. However, this theme
   doesn’t a front-page.php. I tried with both home.php and index.php. What should
   I do next?
 * Thanks for your help!
 * [https://wordpress.org/plugins/jonradio-private-site/](https://wordpress.org/plugins/jonradio-private-site/)

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

 *  Thread Starter [revlow](https://wordpress.org/support/users/revlow/)
 * (@revlow)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/getting-the-cannot-modify-header-information-error/#post-6072815)
 * Oh, wait. I read the error more carefully. This is what it says:
 * > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/gabby/public_html/wp-content/themes/spacious/page-templates/
   > business.php:13) in /home/username/public_html/wp-includes/pluggable.php on
   > line 1196
 * The home page is set up on this business template. I looked at pluggable.php.
   The line 1196 is:
 * `header("Location: $location", true, $status);`
 * And it is part of this:
 * `
    if ( !function_exists('wp_redirect') ) : /** * Redirects to another page. **
   @since 1.5.1 * * @param string $location The path to redirect to. * @param int
   $status Status code to use. * @return bool False if $location is not provided,
   true otherwise. */ function wp_redirect($location, $status = 302) { global $is_IIS;
 *  /**
    * Filter the redirect location. * * [@since](https://wordpress.org/support/users/since/)
   2.1.0 * * [@param](https://wordpress.org/support/users/param/) string $location
   The path to redirect to. * [@param](https://wordpress.org/support/users/param/)
   int $status Status code to use. */ $location = apply_filters( 'wp_redirect', 
   $location, $status );
 *  /**
    * Filter the redirect status code. * * [@since](https://wordpress.org/support/users/since/)
   2.3.0 * * [@param](https://wordpress.org/support/users/param/) int $status Status
   code to use. * [@param](https://wordpress.org/support/users/param/) string $location
   The path to redirect to. */ $status = apply_filters( 'wp_redirect_status', $status,
   $location );
 *  if ( ! $location )
    return false;
 *  $location = wp_sanitize_redirect($location);
 *  if ( !$is_IIS && PHP_SAPI != 'cgi-fcgi' )
    status_header($status); // This causes
   problems on IIS and some FastCGI setups
 *  header("Location: $location", true, $status);
 *  return true;
    } endif;
 * Thanks for any help you can give.
 *  Plugin Author [David Gewirtz](https://wordpress.org/support/users/dgewirtz/)
 * (@dgewirtz)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/getting-the-cannot-modify-header-information-error/#post-6072916)
 * I’ll download the theme and see what I can find out. Give me a few hours. The
   coffee hasn’t yet started working.
 * –David
 *  Plugin Author [David Gewirtz](https://wordpress.org/support/users/dgewirtz/)
 * (@dgewirtz)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/getting-the-cannot-modify-header-information-error/#post-6072927)
 * Okay, so here’s what I did.
    1.  I created a brand new, fresh site. Updated everything to 4.2.1. including standard
        plugins and themes.
    2.  I downloaded and installed Private Site from the wordpress.org repository
    3.  I enabled it (just the main checkbox) and tested against the default WP theme.
        Worked fine. Then I turned it off.
    4.  I then downloaded spacious directly from the WP depository using Add New in
        the Appearance/Themes menu
    5.  Tested the theme to see what it was like before turning on Private site.
    6.  Checked the main Private Site enable button and logged out. Got the login page
        with no errors, and logged in
    7.  I went back into the plugin and turned on Site Home is visible to everyone?
    8.  Once again logged out. This time I was able to go to the site’s home with no
        login screen.
    9.  I then tried to go to the sample page, and got the login screen. I logged in
        and had access to the rest of the site.
 * At no point in this process did I get any header error messages. So what aren’t
   you telling me? What other options do you have set? What other plugins?
 * My recommendation at this point would be for you to repeat my test (I did it 
   on a local XAMPP machine) and see if you get the same results. Alternatively,
   turn off everything else and see where you stand, and then step-wise turn things
   on and see what makes your site explode.
 * Anyway, let me know what you discover. I’ll keep my test site spun up, so if 
   you have more details I can try it out as well.
 * –David
 *  Thread Starter [revlow](https://wordpress.org/support/users/revlow/)
 * (@revlow)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/getting-the-cannot-modify-header-information-error/#post-6072949)
 * Thanks David. I did install some other plugins.
    1.  Askimet
    2.  Anti-Malware and Brute-Force Security by ELI
    3.  Contact Form 7
    4.  Flamingo
    5.  Javascript Html and Text Adder
    6.  Post Duplicator
    7.  Really Simple CAPTCHA
    8.  WordPress SEO
    9.   — haven’t activated yet.
    10. WP Better Emails
 * There are two I haven’t used before, Javascript Html and Text Adder and Post 
   Duplicator. I’ve used similar ones so I can switch if these are the culprit.
 * I’ll go through them one by one and get back to you. Gotta get some more coffee
   first. 🙂
 * Thanks again!
 *  Thread Starter [revlow](https://wordpress.org/support/users/revlow/)
 * (@revlow)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/getting-the-cannot-modify-header-information-error/#post-6072954)
 * Found a fix. Just one of those weird, let me try this again glitches.
 * First I deactivated all the plugins except yours. No change. Then I changed the
   theme to WP 2015 — and got the correct login page. Deleted the Spacious theme
   from my server and reinstalled it. Bingo! It’s working. Go figure.
 * Thanks again for all your help David. This plugin is just what I was looking 
   for.
 *  Thread Starter [revlow](https://wordpress.org/support/users/revlow/)
 * (@revlow)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/getting-the-cannot-modify-header-information-error/#post-6072971)
 * Just marking this “resolved”. I have another Q not related to this, so I’ll post
   it in another topic.
 * Thanks again! 🙂
 *  Thread Starter [revlow](https://wordpress.org/support/users/revlow/)
 * (@revlow)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/getting-the-cannot-modify-header-information-error/#post-6072972)
 * Oops. I forgot to tick “resolved”. 😀
 *  Thread Starter [revlow](https://wordpress.org/support/users/revlow/)
 * (@revlow)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/getting-the-cannot-modify-header-information-error/#post-6072986)
 * Well, this is weird. The error came back. Tried deleting and reinstalling the
   theme again, but this time it didn’t change — still getting the error. Any thoughts?
 *  Thread Starter [revlow](https://wordpress.org/support/users/revlow/)
 * (@revlow)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/getting-the-cannot-modify-header-information-error/#post-6072987)
 * Hi David,
 * Just to update you. I found another plugin that so far seems to be working. Fingers
   crossed.
 * Thanks again,
    revlow
 *  Plugin Author [David Gewirtz](https://wordpress.org/support/users/dgewirtz/)
 * (@dgewirtz)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/getting-the-cannot-modify-header-information-error/#post-6073016)
 * Good luck. Let me know if you need or learn anything. I will download the plugin
   list you mention and see if I can repeat the problem here. Always useful to see
   if there’s anything conflicting.
 * –David

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

The topic ‘Getting the "Cannot modify header information" error’ is closed to new
replies.

 * ![](https://ps.w.org/jonradio-private-site/assets/icon-256x256.png?rev=3370795)
 * [My Private Site](https://wordpress.org/plugins/jonradio-private-site/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jonradio-private-site/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jonradio-private-site/)
 * [Active Topics](https://wordpress.org/support/plugin/jonradio-private-site/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jonradio-private-site/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jonradio-private-site/reviews/)

 * 10 replies
 * 2 participants
 * Last reply from: [David Gewirtz](https://wordpress.org/support/users/dgewirtz/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/getting-the-cannot-modify-header-information-error/#post-6073016)
 * Status: resolved