Yoast SEO Plugin causing my website to break
Hi there- If I activate this plugin (which I LOVE by the way!) I am getting this error message: Warning: Cannot modify header information – headers already sent by (output started at /home/eternity/public_html/wp-admin/includes/template.php:1642) in /home/eternity/public_html/wp-includes/pluggable.php on line 876
and only the header area of my website appears. The entire body of my website disappears… Any ideas what could fix this?
I had this same occurrence. It’s not the Yoast plugin at all; adding this plugin causes the problem to surface.
Here’s what to do…
1. Notice in your error message that the file it’s complaining about is “pluggable.php”.
2. Using FTP (Filezilla is my fav), navigate to the path specified in the error message, and edit the file “pluggable.php”.
3. Go all the way to the very end of this file and add the following two characters on a line all by themselves: ?>
So the end of your pluggable.php should look like this:
... $r .= "<tbody>\n$diff\n</tbody>\n"; $r .= "</table>"; return $r; } endif; ?>
Be absolutely certain that there is nothing after the closing ?> characters.
4. Save the edited file back to your website and you should be good to go.
I did what you mentioned but am still getting the following error:
Warning: Cannot modify header information – headers already sent by (output started at wp-admin/menu-header.php:108) in wp-includes/pluggable.php on line 881
Any other suggestions?
At the risk of sounding presumptuous, be very certain of two things…
1. You put the PHP-termination characters ?> at the very end of the file and it looks like the sample above. There should be no spaces, no new-lines, NOTHING after the ?> characters.
2. You actually REPLACED pluggable.php on your server after editing it. Completely exit your FTP program, start it up again, browse to the location and open the file from the server to make sure!
People can get confused about local vs. remote files with FTP and while you may edit a file locally and it all looks good, you really need to be sure that those edits made it back to the server or you will have done nothing.
Hi there, I actually did a bunch of Googling after I posted this and found a solution that worked like a charm for me. The issue for me was with the first line mentioned in the error. Not the second line. (output started at /home/eternity/public_html/wp-admin/includes/template.php:1642)
I simply went to the template.php file on line 1642 and deleted the white space before the php tag. Then re-uploaded to override the live template.php and it was all good! 😉 Good luck!
Randy, thanks for your post, very helpful. Is this an issue caused by WordPress or the WordPress SEO plugin? I have a load of sites I want to install the plugin on but don’t want to have to go and manually add the closing ?> on all of the sites, it would be nice if wherever the issue lies it could be fixed by the vendor.
Randy, Yes I have done all of those things. I work with FTP daily so I am no stranger to it.
Callie, I also tried your method with no luck.
I have posted the files at a location where you can see them. Please have a look at them and see if you notice anything strange? I saved them as .html so you can view the source code.
Based on what Callie said in her update post, it’s clear to me that there are a couple of places where the problem manifests itself – for me, closing the PHP declaration in pluggable.php did it; for her it was removing the whitespace in template.php.
No, I do not believe that this is a plugin problem because it seems to have started with WP 3.5.1 or maybe 3.5. And it may not even be these two files “at fault” either; it could be a shift in the WordPress framework that is making these all show up.
Yeah, so the short answer is “I dunno” and I’m sure it’s going to start shaking out as more things like this break.
@rch316 – I looked at your two files and at face value they seem OK. I don’t know where else to have you look; the problems I encountered seemed to be fixed by editing pluggable.php.
Just got the same error message for pluggable.php
The file had an extra empty line at the bottom, so I just deleted the line space and everything’s fine now.
If an open PHP tag is not closed at the end of the file PHP does it by its own. It is a common programming technique to avoid the closing PHP tag at the end of the file. Thus no white spaces could be added after the closing tag inadvertently.
These kind of error messages described above usually indicate an error in a plugin, functions.php or some of your code at another place.
The error message means that after the start of the regular HTML output in template.php#1642 the PHP function header() was called in pluggable.php on line 876. But a call to header() does make only sense before any regular HTML output is done.
The call to the header() function takes place in function wp_redirect(). This means that there is a code snippet (plugin or your own) where a redirect was called after regular HTML output has already begun.
I first saw the problem of not being able to switch between visual and text mode in the editor. When I uploaded the latest wordpress-seo plugin I got the pluggable.php error.
I deactivated all plugins
activated wordpress-seo (all ok)
then started activating one plugin at a time
the pluggable php problem showed up again
?>fix at the bottom
Got all my plugins activated and all is well
Thanks for the help!!!
PS can see the site here:http://passionintoprofits.com/
I was unsuccessful at solving the problem so I just installed another SEO plugin and got that one work. I appreciate all of your help with this though. Thanks!
Hi guys, I made this topic: Click and see that I have the same problems as you guys.
My selfmade seo titles are not working anymore in google, I only see the name of the post or page as seo title (meta descriptions still working fine) Maybe it has to do with this issue.
I get this message: Warning: Cannot modify header information – headers already sent by (output started at /home/hans/public_html/symptomenoverspannen.com/wp-admin/includes/template.php:1642) in /home/hans/public_html/symptomenoverspannen.com/wp-includes/pluggable.php on line 876
I can only find the template file on filezilla, not the pluggable.php file. But I have changed the pluggable.php file on my server to what you said randyking.
So it looks now like:
$r .= “<tbody>\n$diff\n</tbody>\n”;
$r .= “</table>”;
But Im not sure what is wrong with line 1642 in my template, what do I have to change exactly?:
<html xmlns=”http://www.w3.org/1999/xhtml” class=”ie8 <?php echo $admin_html_class; ?>” <?php do_action(‘admin_xml_ns’); ?> <?php language_attributes(); ?>>
I still have the problem, when installing seo, so Im not sure what it is?
- The topic ‘Yoast SEO Plugin causing my website to break’ is closed to new replies.