Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML: Multiple language meta descriptions?

Tags:

html

meta-tags

How can I set two language meta descriptions to my website?

Is this code google valid?

<meta name="description" lang="en" content="english blablabla" />
<meta name="description" lang="hu" content="hungary blablabla" />
like image 998
Zsolt Janes Avatar asked Mar 31 '15 08:03

Zsolt Janes


People also ask

Can you have multiple meta descriptions?

Typically, a page should only have one meta description. If there are multiples, it is usually an accident, and may confuse search engines or bring a bit of uncertainty in how you can expect the SERP snippet to look.

Can you have multiple meta tags in HTML?

Using the meta tag, keywords, descriptions, and other information can be specified for the page. HTML meta tags must be placed inside the <head> element. You can use one or multiple meta tags in one document.

How do I fix multiple meta descriptions?

If you have multiple unique URLs with the same meta tags, you may decide to: Change the title of pages to distinguish between the duplicate pages. Add a Canonical URL to indicate which page search engines should index. Set all but one page to noindex.


2 Answers

Check this post from Google Webmaster Central Blog: http://googlewebmastercentral.blogspot.com.es/2010/03/working-with-multilingual-websites.html

"Google tries to determine the main languages of each one of your pages. You can help to make language recognition easier if you stick to only one language per page and avoid side-by-side translations. Although Google can recognize a page as being in more than one language, we recommend using the same language for all elements of a page: headers, sidebars, menus, etc. Keep in mind that Google ignores all code-level language information, from “lang” attributes to Document Type Definitions (DTD). Some web editing programs create these attributes automatically, and therefore they aren’t very reliable when trying to determine the language of a webpage."

Some info about multi languages websites:

Since html "lang" attribute doesn't allow define multiple languages, and meta attribute for specify language is obsolete, according to W3 recommendations, it's better to specify language in the HTTP header.

HTTP/1.1·200·OK
Date:·Sat,·23·Jul·2011·07:28:50·GMT
Server:·Apache/2
Content-Location:·qa-http-and-lang.en.php
Vary:·negotiate,accept-language,Accept-Encoding
TCN:·choice
P3P:·policyref="http://www.w3.org/2001/05/P3P/p3p.xml"
Connection:·close
Transfer-Encoding:·chunked
Content-Type:·text/html; charset=utf-8
Content-Language:·en

Like the meta element with the http-equiv attribute set to Content-Language, the value of the HTTP header can be a comma-separated list of language tags

See: https://www.rfc-editor.org/rfc/rfc2616#section-14.12

As RFC2616 says:

Multiple languages MAY be listed for content that is intended for
   multiple audiences. For example, a rendition of the "Treaty of
   Waitangi," presented simultaneously in the original Maori and English
   versions, would call for

       Content-Language: mi, en

If you go to http://validator.w3.org/check and try to validate this:

<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<meta http-equiv="Content-Language" content="en,hu">
<meta charset="UTF-8">
</head>
<body>
<p>Test</p>
</body>
</html>

W3 validator tool says:

Line 5, Column 52: Using the meta element to specify the document-wide default language is obsolete. Consider specifying the language on the root element instead.

Then, if lang attribute on html tag doens't allow multiple languages, I think your best try will be specify it in HTTP header

like image 97
exoddus Avatar answered Oct 20 '22 04:10

exoddus


The lang attribute may be placed on any element, not just the root html element or meta name="description". So you can write <html lang="en"><body>The Chinese translation of Stack Overflow is <span lang="zh-Hans">堆叠溢位</span></body></html> and it's good to put those lang attributes in because it helps visual browsers to choose the correct fonts and audio browsers for blind people to choose the correct voice.

Some non-Google search engines still want the obsolete <meta http-equiv="content-language"> markup (in particular Bing and Baidu reportedly still want these) but I have no idea if their implementations are standards-compliant enough to cope with two or more languages listed in http-equiv="content-language" (try it and see).

As for whether search engines will honour multiple instances of meta name="description" in multiple languages (with appropriate lang attributes), that depends on the search engine. Google have indicated they don't like side-by-side translations, which is a pity for those of us discussing foreign languages.

like image 23
Silas S. Brown Avatar answered Oct 20 '22 04:10

Silas S. Brown