October 29, 2007

Setting the content language of a website

Posted in Uncategorized tagged , , at 2:03 pm by mondhandy

Just a small thing that I came across in the Xing group Internet-Marketing: there are several ways to tell a visitor (and especially visiting search engine crawlers) what the language of your website is.

  • meta tag in the <head> section of the document: <meta http-equiv=”content-language” content=”de”/>
  • HTTP Response header “Content-Language” sent from the web server
  • xml attributes lang and xml:lang in the html element of a website in xhtml:
    <html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
  • lang attributte in the html element of a website in html: <html lang="de">

(My examples are for language German, for other languages replace the “de” accordingly, ie “en” for English)

I had only one of those, the meta tag, and the web server was even sending the wrong Content-Language Header, marking the website as targeted to english speakers.

In general, according to this SEO blog article, the language headers don’t influence the search engine ranking, since the crawlers do their own guessing of the language. However, I was glad to have found these issues anyway. One small step more towards perfecting the website. It certainly doesn’t hurt to get those details right, either. Besides, other search engines might be less dilligent than Google when it comes to determining the language. The worst case would be to be put into the wrong part of the index by the search engine, for example my website would not appear in the search results of the german variant of Google, only in the english one.

Reference: the information about the xml:lang and lang attributes I found in this article (in german). I tried looking them up in the W3C specifications of XHTML, but they are almost unreadable.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: