chris
chris

Reputation: 21197

How to specify language of website? (HTML?)

How do I specify that a page is in a certain language so search engines can understand?

Is it a meta tag I put at the top? If it is, do you know if most of the search engines use this to determine language?

I have converted 1 page of content in english to several different languages, and would like to include that information in the html/let the search engines know which language they are dealing with.

Upvotes: 13

Views: 23641

Answers (3)

Tres
Tres

Reputation: 5674

Depending on your dtd:

HTML:

<html lang="en">

XHTML:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

If you are using a right to left language:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="he" lang="he" dir="rtl">

If using XHTML, you'll want to specify both the xml:lang and lang attributes. The xml:lang attribute takes precedence over lang.

Upvotes: 15

jitter
jitter

Reputation: 54605

Check this page for a range of things you can do to try to get the search engine to pick up the right language.

How to Specify an HTML Web Document Language for good SEO

(In no particular order)

  1. right domain suffix
  2. hosted in right county
  3. AddHeading syntax (Apache)
  4. <meta http-equiv="Content-Language" content="yourlanguage" />
  5. <html lang="yourlanguage"> for xhtml <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="yourlanguage" lang="yourlanguage">
  6. <p lang="yourlanguage">
  7. <meta http-equiv="content-type" content= "text/html; yourcharset">
  8. And search engines to text pattern analysis too (prefix/suffix of words, n-grams analysis)

Upvotes: 8

SingleNegationElimination
SingleNegationElimination

Reputation: 156128

Quick google search gave me this: HTTP and meta for language. tl;dr

<html lang="en">

There are other ways of specifying. If you are using apache, you can use a file extension for apache to pull the correct version based on the user-agent's given preferences. for example, name your index page index.html.en, index.html.jp, index.html.de and so on...

Upvotes: 19

Related Questions