Friday, 24 June 2011

Code Conundrum

A HTML-comment is a string of code within HTML, XML, and CSS that is not viewed or acted upon by the browser or parser. It is simply in the code to provide information about the code or other feedback from the code developers.

Apparently comments in HTML are used for nearly anything, from explanations of complex table structures to sarcastic outtakes of the content of the page. Many developers use comments to hide portions of the page that are going to be used later. They are used to tell other people working on the page information about the page.
So now, I had a fair understanding of what it was and what it did. Nevertheless, I was still clueless what this HTML-comment meant for the keywords it contained. So I decided to ask some of my code-savvy contacts. One of their remarks was rather offensive, so I won't bore you with details about being blonde etc...

Yes & no
Most of them replied that anything between the brackets of a HTML-comment will not be indexed by robots. Others told me that they’d never heard of content in a HTML-comment not being indexed by search engines. This did not help me to get out of my clueless state. It is either yes or no, not both...or is it? Errrrr.....

I know my redeemer liveth!
One argument though, changed my clueless stalemate to a cunning over confident state. One simple explanation that said it all! One of my contacts texted me: “Google remains to be a BLACK BOX”, suggesting that a certain percentage of our online succes is in the hands of big brother Google, “to be a 100% sure that Google about indexing is virtually impossible (pun intended). Basically, he  assumed that Google ignores HTML-comments and its content. He concluded with: “because, if Google would index HTML-comments it would be incredible easy to indulge in keyword stuffing.

It's logic Jim, but not as we know it!
Than I saw the light!! Since a HTML-comments are used for ‘nearly anything’, among which, ‘hiding portions of a webpage’; undoubtedly, they would be used to stash humongous numbers of relevant and/or popular keywords. Keywords that will be indexed by Google. Anything to get a higher ranking eh? Now why didn’t I think of that? It’s pure logic! 

Examples 4 da copy-pasters

<!--end header-->
<!--Note to self: This is my banner image! Don't forget -->
<!--You moron. Comments are not displayed in the browser-->
<!--end header-->
<!--Note to self: This is my banner image! Don't forget -->
<!-- I am a comment. I feel invisible though. -->
You can't see me....
unless you look at the page source code. 

No comments:

Post a Comment