1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Does applying CSS to an h1 element affect SEO?

Discussion in 'XenForo Questions and Support' started by Brogan, Sep 28, 2011.

  1. Brogan

    Brogan XenForo Moderator Staff Member

    An interesting question has arisen in relation to SEO; well, as interesting as SEO can be...

    On the forum home page there is an h1 element which contains the forum name; in the case of XenForo.com it's XenForo Community.

    Quite a few people have asked how this can be removed, but only on the forum home page.

    This can be achieved several ways using CSS applied to EXTRA.css.

    This one sets the font size to 0px:
    .forum_list .titleBar h1 {
    font-size: 0px;
    This one prevents it from being displayed:
    .forum_list .titleBar {
    display: none;
    I pay very little attention to SEO so will either of those affect it?

    In both cases the h1 element is still present in the page source, it's just not visible.
  2. bambua

    bambua Well-Known Member

    In my experience google does pay attention to the heading tags when it finds/examines keywords on a page so I have always included them for the page titles and such. In this specific situation though I'm not sure, would be interesting to find out.
  3. Onimua

    Onimua Well-Known Member

    If it's hidden via CSS, I don't see what difference it would make since spiders look at the HTML itself, don't they?
  4. bambua

    bambua Well-Known Member

    I think that's what he meant, if you don't want it there does it help SEO to just hide it from vision or should you get rid of it all together.
  5. Brogan

    Brogan XenForo Moderator Staff Member

    That's my understanding too, I just want to clarify it to put the minds of others to rest.
    Xarcell likes this.
  6. bambua

    bambua Well-Known Member

    You can test this pretty easily, using Google Webmaster Tools you can view the page as the google spider will. I just tried it on one of my pages and google still sees with either of those CSS entries.
    Brogan likes this.
  7. dutchbb

    dutchbb Well-Known Member

    Last edited by a moderator: Jul 31, 2013
    Learner likes this.
  8. Brogan

    Brogan XenForo Moderator Staff Member

    Thanks guys, pretty much as I suspected.

    I'm aware of Google's policy on cloaking, but hopefully they will realise that this is just for cosmetic/aesthetic reasons and not to try and game the system in any way.
  9. Carlos

    Carlos Well-Known Member

    The cloaking you refer to is embedding keywords into the bottom (common practice) and deceive visitors from knowing what's with the white space. In this instance; let's say your site is xenforo, and you want a a thousand keywords at the bottom, which means you want a light grey color for your keywords.... This is where Google punishes you.

    While what you want to accomplish doesn't really punish you, it doesn't help, either... because you're almost removing the H1 tags.
    Learner likes this.
  10. bambua

    bambua Well-Known Member

    I'm not sure how it doesn't help, it has no effect on how the spider sees it.
  11. Carlos

    Carlos Well-Known Member

    "Quite a few people have asked how this can be removed, but only on the forum home page."

    When visitors come to your site, they see board title with H1 tags... the bots, see it too...

    So, what happens when you remove it? Especially if you put keywords that YOU want in the forumhome?

    Let's suppose for a second you want to target Modern Warfare 3 fans, if you really want to do it, you put it in the board title and leave the H1 tags. Google and other search engines will find you based on that. Removing it means losing SEO trails to your [landing] site.

    This means a decrease in visits to your site.

    So, this leaves Google and other search engines to find your thread titles instead...which is a lot harder than you think... unless you use twitter or facebook for marketing.
  12. bambua

    bambua Well-Known Member

    Both of the examples he gave are ways of removing them from view, not physically removing the H1 title from the HTML. Just removing it from how it is rendered in the browser. This is no different than using a span with a background image in a H2 tag and using a text-indent: -99999 or whatever to throw the text off the screen and just show your image. They are both ways of effecting the rendered view while still giving screen readers and the search bots the text you want them to see.
  13. Carlos

    Carlos Well-Known Member

    HmmmMmm'kay. :censored:
  14. Xarcell

    Xarcell Well-Known Member

    as long as the HTML is in order, Google doesn't really care how you style it.

    What about just styling it with display:none;
    bambua likes this.
  15. Brogan

    Brogan XenForo Moderator Staff Member

    That's one of the suggestions in my opening post, and is what I do on my site.
    bambua likes this.
  16. bambua

    bambua Well-Known Member

    That's what I was saying too, unless your deceiving users with the CSS they don't really care.
  17. Xarcell

    Xarcell Well-Known Member

    Sorry, skimmed the post and seen setting the font size to 0. Using display:none; would be most proper in my opinion without redoing all the HTML.
  18. Floris

    Floris Guest

  19. Brogan

    Brogan XenForo Moderator Staff Member

    Thanks Floris, we've already discussed Google's cloaking policy.

    My understanding is that as it's not "deceptive in intent" then it should be fine.
    It's simply done for aesthetic reasons.

    Of course Google may see things differently.
  20. Floris

    Floris Guest

    Sure, but now you have the info directly from Google - not a third party site with an opinion.
    And as you said, if you're not trying to game the system, there's nothing to worry about (SEO) wise.

Share This Page