: How can I add meta tag for multi-lingual website? Currently I m using <meta name="keywords" lang="en" content="..."/> <meta name="description" lang="en" content="..."/> for meta lang declaration.
Currently I m using
<meta name="keywords" lang="en" content="..."/>
<meta name="description" lang="en" content="..."/>
for meta lang declaration. But my website is multilingual. Now how can I change this meta tag to support multilingual meta lang tag?
More posts by @Rambettina238
2 Comments
Sorted by latest first Latest Oldest Best
You have good intentions, but you are using some elements wrong, so let me clarify a few things and the answer to your question will be at the end.
Each page on a site has a language, that means that there is one main language for the content of a given page. That language, should be defined on the right meta tag, specifically, content-language, like this
<meta http-equiv="content-language" content="en" />
For consistency, and to avoid potential problems with agents that don't pay attention to that tag, you should use the lang attribute on the outermost, relevant, element/tag of the document, which is the html tag, like so
<html lang="en">
If on that page, you have a fragment that is in a different language, you have to change the language for that element, only, using the lang attribute, like so
<p lang="es">texto en español</p>
If, on the other hand, you have different pages, let say, one in english and one in spanish, on your head section, you should have a link element on your english page:
<link rel="alternate" href="http://example.com/es" hreflang="es" />
and a link element on your spanish page
<link rel="alternate" href="http://example.com/en" hreflang="en" />
Then, on each page, you will have the right metadata, written on the corresponding language; so this would be the english version
<meta name="keywords" content="keywords in english"/>
<meta name="description" content="description in english"/>
And this would be the metainformation in spanish:
<meta name="keywords" content="keywords en español"/>
<meta name="description" content="description en español"/>
Again, if one single page has more than one language, there would be one dominant and so, that is the language you should use on the metainformation. If by any change, the page is really 50% - 50%, then you can duplicate the information, write half in one language and the second half in the other one, both separated, for instance, by a dash. But a truly 50 - 50 site is not very common.
If different pages have different languages, you should use the <rel hreflang="xx"> tag. It's basically a tag that says which language the page is in. You can read more about it on support.google.com/webmasters/answer/189077
If a page has multiple languages, I can't help you.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.