Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Is there anyway that too many HTML comments in a document can effect SE rankings? Do the spiders ignore all of them?

share|improve this question
    
Its good practice to limit your comments, they do waste bandwidth. Search engines might not care, but having unnecessary comments weighs down the total data you send to your clients. This may not seem like much but it can and will add up. Remove them if they are not necessary. –  Frank Nov 17 '10 at 16:56

3 Answers 3

up vote 7 down vote accepted

They are completely ignored so no, it doesn't affect rankings. The only problem might be if you have such a massive amount of text in comments, that it increases the load time significantly. Users might go elsewhere.

share|improve this answer

This is a debate within the SEO community but I think this can be an issue if overdone. While things like comments and scripts make no sense to a search engine spider, if over done they can still affect the code to content ratio which can dilute the effect of any optimization as the content which does affect rankings starts to be interfered with by the noise of scripts and comments that don't.

One of the worst examples of this I have seen is with the __VIEWSTATE field in ASP.NET with some CMSs that leave a massive block of encrypted gobbledygook in the middle of the markup to maintain state with the server.

As a rule I wouldn't worry about code to content ratio too much but definitely adhere to best practice (ask yourself what would Chuck Norris do and don't over do scripts/comments) and remember that the limit of the Google cache is about 101kb per page and this should be considered the absolute limit. Spiders will give up on anything larger than this.

There is a good discussion in this SEOMoz forum thread.

share|improve this answer

If you're using a server side language, you could always put some comments inside comment tags in that language. I do this for comments I don't want outputted, or for situations where I'm taking down a section and don't want people to be able to view it like so...

<?php // php comment example
/*

<strong>DON'T WANT ANYONE TO SEE THIS</strong>

*/
?>

Your HTML page will be smaller, but your PHP process will be interpretting more... not sure which is more efficient, so for me it comes down to need.

share|improve this answer

Your Answer

 
discard

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.