Aug 20, 2009

Error: Headers already sent, /wp-includes/pluggable.php [WordPress]

Aw, Snap!So, you’re using WordPress and you just spent hours looking for the perfect theme to fit your new hybrid kitten-and-knitting blog. You upload the theme’s files into the appropriate folder, navigate to the themes page in the  administrative interface, and click “activate.” So far, so good, right? Later, you notice that anytime you save a page, post, or option, you’re greeted with an error much like the following:

Warning: Cannot modify header information – headers already sent by (output started at /home/user/public_html/ccc/wp-content/themes/broken-theme/includes/theme-options.php:172) in /home/user/public_html/ccc/wp-includes/pluggable.php on line 237

The exact nature of the error and line numbers will vary. The point is, your frilly new theme is broken or there’s a plugin conflict with it. Here’s a funny thing that happened with my situation and I suspect others may benefit from this tip. If you’re receiving these errors, and you’re still logged into your WordPress admin panel, activate a different theme you know works. The real problem begins if you log out.

If you are unable to access any portion of your site, or most importantly, the log in page, you’re going to need to get your hands dirty.

  1. FTP into your WordPress themes folder, then to the folder for the offending theme (i.e. wp-content/themes/broken-theme).
  2. Copy everything within that theme’s folder to another folder on the server, or to your hard drive (or just delete if you plan on installing fresh).
  3. Copy the files from a known-good theme (like the included “classic” or “default”) into the folder you just emptied.
  4. You should now be able to access your log in page. (www.yourdomain.com/wp-admin/)

You could just leave it as is and set out to fix or replace your bunk theme, however, I recommend “officially” activating the theme you wish to revert back to, then deleting the duplicate you created in step 3.

4 Comments

  • Most times, when header data is already sent, that means that the page generated some sort of error and did an “echo” unexpectedly. The most likely echo that would occur is a mysql error when a query goes awry.

  • So, what’s the CAUSE? Any clue? Poorly coded themes?

  • @Neil, from what I read, yes, the problem lies with the theme. Something simple like a misplaced div or a stray end bracket can cause problem. In my case, the theme I was using was a premium theme I purchased and had customized by a professional designer and theme developer. Once I notified him of the problem, he quickly recreated it and patched the issue.

    From what I can tell, the problem had something to with calling certain part of the page too soon, above a submit action, instead of after.

  • error login WP this comment error

    Warning: Cannot modify header information – headers already sent by (output started at /home/hosgat11/public_html/GRFXDESIGN.NET/wp-content/themes/simplemarket/functions.php:207) in /home/hosgat11/public_html/GRFXDESIGN.NET/wp-login.php on line 353
    whay mr thank