Demystifying Google's text-indent mystery

Written by That Web Guy on 9th September 2009. 11 comments

Demystifying Google's text-indent mystery
  • Avant Innovations
  • Advertise Here

Once upon a .com boom time, back when search engines predominantly ranked sites based on keywords alone, there was a common practice in SEO carried out by every web designer and his dog - something called 'cloaking', a form of keyword spamming.

This practice at the time was allegedly the Holy Grail of ranking highly in search engines, and usually consisted of spamming your page with keywords that were invisible to the user but visible to search engines – white text against a white background was a common method.

Naturally it didn't take long before search engines realised this was affecting the reliability of their search results, and they started penalising for such practice by changing the way they ranked sites by introducing more variables, such as checking for link popularity, duplication, relevance, stagnation and more.

The concept behind this outlawing was simple: It's deceptive. If the user can't see it, then it has no place hiding on the page. Imagine for a moment, that you arrived at search engine results and one particular link promises information about Dell notebooks, but when you visited the page it was a completely unknown brand. This sort of thing used to be rampant.

Fast forward to today and designers are, in a similar way, using this very same practice although with legitimate intentions. I'm of course referring to the art of image replacement using text-indent, which for our noobie audience is the practice of moving text off the screen via CSS to reveal an underlying image. Example:

<h1>My web site design services</h1>
h1 {
text-indent:-9999em;
background-image:url(heading_web_sites_services.gif);
}

The result of this is the text being rendered off-screen in order to not get in the way of the image, which in this case is a header with a non-standard font used to fit in with the design.

But hold on a second: Going by Google's webmaster guidelines on this subject, this is technically a form of deception, as they note (emphasis added by me)...

Hiding text or links in your content can cause your site to be perceived as untrustworthy since it presents information to search engines differently than to visitors. Text (such as excessive keywords) can be hidden in several ways, including:

Using white text on a white background
Including text behind an image
Using CSS to hide text
Setting the font size to 0

Cue the grey area. Reading further Google actually recommend using an image instead as long as it's accompanied by an alt attribute. What does this tell us, besides (surprise surprise) providing further evidence of Google's lax attitude towards modern web design principals? To me, this means that Google's algorithm might not be very good at detecting the difference between...

<h1>My web site design services</h1>

...and...

<h1>cheap web sites, affordable web sites, web site discounts, custom web sites, cheap hosting</h1>

...when text-indent is used, which is why they still have to manually check web sites for quality. I've used this technique on a stack of sites all of which rank highly organically on Google and all of which, according to Google, are using deception.

It appears Google's issue is really only with the deceptive practice of using text-indent for keyword spamming. By that logic, they (technically) should have no problem if text-indent is used legitimately as shown in the first example, because we're simply replacing text with an image of exactly the same text. There's no deception.

Something contradictory interesting to note on this subject is that Google go against their own recommendations. Disable the styles on Gmail and you'll see the words Google Mail Logo inside an h1.

Is it really good practice?

Until I see any proof to suggest otherwise, I have no plans to change the way I do things. Aside from keeping the mark-up semantic (because we're using an actual heading instead of an image), it makes the document more accessible to people relying on screen readers, and it means we're sticking to the golden principal of separating presentation from content. These are all good enough reasons.

Keeping it real

The rule to remember when using this technique is to use it for the intended purpose. The example shown at the beginning demonstrates a legitimate method of solving a semantics problem while simultaneously maximising accessibility on that component, whereas the second example is clearly designed to spam search engines. If Google catch you in the second practice, they won't tell you but you'll know all about it when you see your site disappear in a search engine black hole.

As long as you're intentions aren't deceptive using text-indent should not have any negative impact on your SEO. I've seen the complete opposite on more occasions than I've had hot dinners.

I say if it's been treating you well so far, stick with it (if it aint broke don't fix it), but keep one eye on the SEO game because Google can change the rules on a whim.

Is this worth sharing?

That Web Guy

About That Web Guy

That Web Guy (Mikey to his friends) is a veteran web designer based in Perth, Western Australia, and currently Design Director at Perth Web Design. When he's not XHTML'ing or messing around in Photoshop, Mikey can usually be found preaching web standards evangelism onto unsuspecting victims.

Feel free to send That Web Guy a message some time, follow him on Twitter, or make a donation.

Comments

Josiah

Josiah

Nice article. But on a side note: gmail's not exactly a prime example of semantic markup & accessability, so i'm not surprised that they have something silly in the h1 tag.

Wednesday 9th September 2009 | 08:17 PM Reply Comment URL Profile Back to top

CSS Babe

CSS Babe

Superbly explained as usual. Before reading this I never thought that it might have been having an impact...the lesson is I don't have to change the way I do it now anyway.

Wednesday 9th September 2009 | 09:07 PM Reply Comment URL Profile Back to top

Not a Member

Branigan

Nicely written. What do you think about using the h1 on every page for a logo?

Thursday 10th September 2009 | 05:10 PM Reply Comment URL Back to top

That Web Guy

That Web Guy

Responding to this comment by Branigan

Thanks Branigan. Technically the h1 is reserved for a heading, so semantically speaking I wouldn't place a logo in it on every page. Unless the content of the h1 is actually a heading, not something describing the logo like "Mike's Web Site Logo".

Thursday 10th September 2009 | 05:26 PM Reply Comment URL Profile Back to top

Not a Member

Elvoski

Good reading. I reckon too much fuss is made of the text-indent seo thing. My sites don't seem to be affected either.

Tuesday 15th September 2009 | 07:10 PM Reply Comment URL Back to top

Not a Member

Ajay

Do you recommend length of text in H1 tag?
Is it a good practice to have keywords in H1 tag?

Friday 30th October 2009 | 07:05 PM Reply Comment URL Back to top

That Web Guy

That Web Guy

Responding to this comment by Ajay

There is no actual correct length, except to say because it's a heading, the text should be exactly what the heading needs to be. Google is pretty smart, and will quickly notice (and penalise) if you're using a heading for the purpose of keyword spamming.

Friday 30th October 2009 | 07:16 PM Reply Comment URL Profile Back to top

ScottFoley

ScottFoley

Responding to this comment by Ajay

That Web Guy is correct. Yes it is important to use keywords in H1 tags but be logical about it. Like Mike said Google is smart and can tell when you are keyword stuffing your H tags. You may not be caught at first but you can bet you will eventually be found out. It needs to read like a header and not like someone trying to put more keywords on their page.

IE: "Fruit and Flower Baskets" vs "Fruit Baskets, Flowers, Gifts, Flower Baskets, ..." you get the idea.

Great article Mike.

Friday 13th November 2009 | 03:12 AM Reply Comment URL Profile Back to top

Fenderson

Fenderson

Sorry to be off topic but I wanted to say I love the design it's very easy to read. Is there a template I can download somewhere?

Tuesday 15th June 2010 | 06:26 AM Reply Comment URL Profile Back to top

Not a Member

youngstream.net

Nice article, have been wondering myself.

In a project I'm working on, there's an image with some snazzy text,
for obvious SEO reasons I typed in the text and made it disappear using text-indent, also, I added an H1 to it with the content being the title of the site (no keyword stuffing).

I'm thinking it won't get any penalties for this right?

Sunday 29th August 2010 | 09:35 PM Reply Comment URL Back to top

That Web Guy

That Web Guy

Responding to this comment by youngstream.net

That's right. As long as the text in the H1 is the same that is in the image, Google should not see this as any attempt at deception, so it's all cool in the gang.

Monday 30th August 2010 | 06:21 AM Reply Comment URL Profile Back to top

FYI: You are currently not logged in. It's cool though - you can still comment. But only members get a profile page, access to the download section and they can pimp their own web sites. Feel free to register or Login now!

Your name:

Your comments:

Note: HTML tags are automatically stripped from comments.

Are you human?
Turing

Sorry, I have to ask. So what sort of animal is this? (Hint: you don't have to be perfectly specific)

Back to top

Login to That Web Guy Blog

Login

Not registered? | Forgot your Password? Cancel Login