google rankings

I have a question for webmasters out there who have some experience with SEO. How does Google treat the following?

a) Text that has class=”foo” where class foo is undefined.
b) HTML comments (including IE’s conditional comments).

My expectation is that it that for (a), class foo will be ignored entirely (no loss or gain in terms of SEO), and that HTML comments (including conditional comments) are also ignored entirely.

Does anyone have evidence to the contrary? Maybe some Mozilla folks out there know about this. I’m not worried about this for my blog, but another site that is considering advertising Firefox in place of some normal header text. For them, even marginal loss in terms of SEO may place it below another competing site (which would be unacceptable). Thanks in advance for your input.

This entry was posted in Google, Mozilla. Bookmark the permalink.

10 Responses to google rankings

  1. Colin Ramsay says:

    As far as I’m aware, you’re correct. Neither classes or comments affect SEO.

    What I would suggest if the site wants to replace header text with a background image for Firefox. This is fairly simple:

    http://www.mezzoblue.com/tests/revised-image-replacement/

    The search engine robots will still see the text but users will see an advertising image.

  2. Jonas says:

    > Text that has class=”foo” where
    > class foo is undefined.

    There is no means in HTML to predefine a list of allowed classes. What do you mean by “undefined”?

  3. Ali Ebrahim says:

    I mean that I’m using class=”foo”, where I don’t define a called called foo anywhere. Nothing to with allowed or disallowed.

  4. Ross Shannon says:

    There’s no corresponding style declared anywhere, I assume. As Colin says, I don’t think Google takes either into account. The logic required to give extra weight to terms used in whatever div a site uses as its header — taking into account all of the different class names people give them — would be enormous.

  5. Jonas says:

    > I mean that I’m using class=”foo”, where I
    > don’t define a called called foo anywhere.
    > Nothing to with allowed or disallowed.

    But I must ask again, what do you mean by “define”? How does one define a class? I do not understand your terminology.

  6. Ali Ebrahim says:

    For example, usually if I have a class foo, then I’ll have something like this in my CSS:

    .foo { attribute: value }

    and then use a <div class=”foo”> somewhere. But what if I use <div class=”foo”> without having .foo { attribute: value } anywhere in my CSS. That’s what I mean. I don’t know how to explain it any clearer than that.

  7. e|vo says:

    A Search Engine will still “see” the text included in your class. It doesn’t give a dam on classes. Therefore you can feed search engines with {display:none;} or {visibility:hidden;}, what is still indexed.

  8. Ross Shannon says:

    Yeah, but I’d say if search engines do ever start reading corresponding style information, that last one will be the first one to be checked for. It’s basically the old keyword spam trick that they do check (and penalise) for, carried out thusly:

    spam keywords

  9. Ross Shannon says:

    Erk.

    <body bgcolor=”white”>
    <font color=”white”>spam keywords<font>

  10. Jonas says:

    Ah, by “define a class” you mean applying CSS rules to elements with that class. Me sees. Note that classes have many other uses than hooks for stylesheets, tho’.

Comments are closed.