37

When content is hidden by CSS (display:none), is that read by Search engines or are sites penalised for that ? In my case, due to some CMS and other reasons, I need to serve alternative content to users and hide the H1 tag on the page using display:none. I wanted to know if the Search Engine will still treat the H1 tag with the same prominence as when its not hidden.

Nima Derakhshanjan
  • 1,380
  • 9
  • 24
  • 37
Iris
  • 1,321
  • 4
  • 17
  • 19

10 Answers10

34

It's against Google's policy. It's called keyword stuffing and will get you delisted from Google, which means your site wont even show up on Google anymore. A good rule of thumb is to only show googlebot what users of your site can perceive display.

If you show the information to people at some point, then you can argue you're not keyword stuffing I guess, but Google will delist you first and then you'll have to file an appeal.

Bjorn
  • 69,215
  • 39
  • 136
  • 164
  • 1
    What if you have a image for the header of your website, which you would like to represent in with

    Title

    and
    • Service
    • Service
    ? Would google shun this? Or is the alt/longdesc properties of an image considered better to use in this scenario?
    – Hux Apr 22 '10 at 16:38
  • 5
    Use an alt tag for the image. You can put an image tag inside

    tags. Don't hide elements with display:none if you never intend to show them.

    – Bjorn Apr 23 '10 at 17:46
  • Can you provide links to your opinions please, instead of generals? – eduncan911 Aug 30 '10 at 18:56
  • What about providing offscreen content for screen readers (which is generally good SEO practice as well) using position:absolute and left:-50000px or something similar? Perhaps the text is provided visually in a graphic, but you want live text for those purposes: I seriously doubt Google would consider that keyword stuffing! – Marcy Sutton Aug 10 '11 at 23:20
  • You can try it and find out I guess. Sounds like hidden text to me. – Bjorn Aug 11 '11 at 01:40
13

I don't believe that Google will penalize you automatically (meaning without human review), but it's definitely a risk, especially if the hidden text appears to be that way solely for SEO purposes.

Google Quality Guidelines - Hidden text and links

Chad Birch
  • 73,098
  • 23
  • 151
  • 149
  • I would prefer to not have to hide the text for the h1 but just move it offscreen so that its not visible to users. What's the best way to do that besides using text-indent to move it offscreen ? – Iris Apr 16 '09 at 04:13
9

Search engine builders have had about 15 years to learn every trick that people use to get better search engine ratings, so you can be sure that the robots notice something simple like hidden text.

If the header tag is not visible on the page, it's pointless to have it there at all. At best the search engines will ignore the tag. At worst they will ignore your site.

Guffa
  • 687,336
  • 108
  • 737
  • 1,005
  • "At best the search engines will ignore the tag. At worst they will ignore your site" I love this remark. I am not sure who is right or who is wrong, it seems everyone gets some grounds to argue. Only this commment reveals the truth. Good point Guffa! – tag Aug 19 '09 at 09:03
7

Search engines are getting wise with regard to CSS techniques to hide information in attempts to game them. There is likely to be a threshold however, so one or two such techniques, for valid enough reasons won't be too problematic for you. If you can, do try to avoid them, and especially en-mass.

Alister Bulman
  • 34,482
  • 9
  • 71
  • 110
3

There is no reason why you can't hide the H1 tag - it's not necessarily a bad thing. Vision impaired people who are reading your website with a screen reader would find the hidden H1 useful regardless if it's hidden (because most screen readers read the HTML not the visual page). Also if you visually have a business logo on the page and then have a hidden H1 with the business name, this is also fine. In this case the H1 is an alternative to the Logo so it is therefore fine for purely semantic reasons.

Also you can have hidden content that can 'appear' by user interaction (say clicking on a 'more' link). This is also fine. Hiding text is not wrong providing there is a good, usability reason for doing it. Of course keyword stuffing is wrong and this should never be done - so an SEO reason is never enough alone to hide text - there must be some other reason.

Matthew James Taylor
  • 4,806
  • 5
  • 29
  • 33
  • I was pretty sure Screen Readers did read the CSS... after all, why would there by voice specific properties? – alex Apr 17 '09 at 00:31
  • They ignore most CSS, but display:none and visibility:hidden WILL hide content from screen readers. This is helpful for tab-switchers and other content that you wouldn't want to force them through when it's hidden for visual users. – Marcy Sutton Aug 10 '11 at 23:21
1

Its not a discussion about that search engine should consider it or not. Its a question about what search engine will do. Here is your answer http://support.google.com/webmasters/bin/answer.py?hl=en&answer=66353

Search engine will discard it, and also its against their terms of use so they have right to even remove your site from search result.

Rahul Prasad
  • 8,074
  • 8
  • 43
  • 49
1

Using a .visuallyhidden class might be a better idea than the good old display:none; Screen readers will read the content in .visuallyhidden as if it were plain text.

.visuallyhidden {
    border: 0 none;
    clip: rect(0px, 0px, 0px, 0px);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px; 
}

I'm not sure if Google penalizes the use of such classes in h1 tags. But in any case I think it is a better option than using display: none;

Bernie
  • 1,489
  • 1
  • 16
  • 27
olefredrik
  • 21
  • 2
1

As already mentioned, it is not a good idea to hide information for many purposes.

If actually, what you really want is to serve visitors an alternate media than plain text, there are a lot of ways to do that, just see Nine Techniques for CSS Image Replacement for further details, or sIFR.

viam0Zah
  • 25,949
  • 8
  • 77
  • 100
1

You're better off not doing this.

Search Engines like Google are smart and they check for this type of thing and when you're caught, you'll get flagged and your SEO is useless.

Work within the system, don't try to cheat it. Google offers a ton of tools for developers looking to do legitimate SEO.

Gavin Miller
  • 43,168
  • 21
  • 122
  • 188
0

you can set the background to the as the image you want people to see and then text indent the text to -9999px.

Justin
  • 25
  • 1