Thursday, May 24, 2012 at 10:31 AM
Webmaster level: All
In December 2011 we announced annotations for sites that target users in many languages and, optionally, countries. These annotations define a cluster of equivalent pages that target users around the world, and were implemented using rel-alternate-hreflang link elements in the HTML of each page in the cluster.
Based on webmaster feedback and other considerations, today we’re adding support for specifying the rel-alternate-hreflang annotations in Sitemaps. Using Sitemaps instead of HTML link elements offers many advantages including smaller page size and easier deployment for some websites.
To see how this works, let's take a simple example: We wish to specify that for the URL http://www.example.com/en, targeting English language users, the equivalent URL targeting German language speakers http://www.example.com/de. Up till now, the only way to add such annotation is to use a link element, either as an HTTP header or as HTML elements on both URLs like this:
<link rel="alternate" hreflang="en" href="http://www.example.com/en" >
<link rel="alternate" hreflang="de" href="http://www.example.com/de" >
As of today, you can alternately use the following equivalent markup in Sitemaps:
<url>
<loc>http://www.example.com/en</loc>
<xhtml:link
rel="alternate"
hreflang="de"
href="http://www.example.com/de" />
<xhtml:link
rel="alternate"
hreflang="en"
href="http://www.example.com/en" />
</url>
<url>
<loc>http://www.example.com/de</loc>
<xhtml:link
rel="alternate"
hreflang="de"
href="http://www.example.com/de" />
<xhtml:link
rel="alternate"
hreflang="en"
href="http://www.example.com/en" />
</url>
Briefly, the new Sitemaps tags shown in bold function in the same way as the HTML link tags, with both using the same attributes. The full technical details of how the annotations are implemented in Sitemaps, including how to implement the xhtml namespace for the link tag, are in our new Help Center article.
A more detailed example can be found in our new Help Center article, and if you need more help, please ask in our brand new internationalization help forum.


74 comments:
much smarter solution than coding it into every page of the site. nicely done.
Just a quick question: Is there any consequence if I do not use this? It would really force me to make many changes on my site, something I can't do at the moment.
Thanking you,
Tedel
@Tedel Do searches for your site on various international google properties you are targeting (e.g. in German on google.de if you are targeting also Germany). If you are satisfied with the results you won't need to add annotations. If you are not (e.g. your English content ranks higher than your German content for users in Germany), chances are that the annotations might help you.
The Quick Question, does it affect indexing if adding this in to my existing sitemap and resubmit?
@Akshay Vyas updating your existing sitemap will work just fine, we will pick up the changes.
For extra safety, be sure to verify via webmaster tools that the sitemap didn't encounter any parsing issues (and/or test locally by validating against the XSDs).
it is effecting my sitemap, my sitemap's pages are deindexing from Google Webmaster, how can i get all sitemap pages indexed?
Interesting tip. Thank's for sharing!
@aditya that goes beyond this new announcement. Please bring your question to the Webmaster Help Forum.
Hello,
Are you sure the example is correct in the blogposts? it says:
http://www.example.com/de
http://www.example.com/de
<xhtml:link
rel="alternate"
hreflang="en"
thank you in advance for a reply
@Bas
The blog post example looks correct to me, what exactly do you think is wrong?
Hi Christopher,
Thanks for your fast reply.
in the example .../de has a rel=alternate to hreflang="de"
This doesn't seem to be an alternatieve language, since the url /de refers to alternate hreflang ="de".
the first example seems more logic where it says /en rel= alternate to hreflang="de"
I hope you understand the example.
@Bas as stated on
http://support.google.com/webmasters/bin/answer.py?hl=en&answer=2620865
the self-reference is relevant as well.
This appears to be an excellent way of doing the HREFLANG tag, thank god I didn't spend that small fortune to the developers to integrate the tag into our multilingual websites... we we're so close and the sitemap option seems much more simpler.
As this is stating that the page is an alternative, what is taken as default?
Default is whatever would happen without those annotations.
I have a multilingual site: each language has 60 pages. I want to know if I must use alternate rel for each link in the sitemaps or I must use only one alternate rel per sitemap.
I hope that you understand me.
Thank you in advanced.
this is really a great one... so we can use in website for multiple country as well as for blogs...
this will really useful... great one...
this is really a great one... so we can use in website for multiple country as well as for blogs...
this will really useful... great one...
@Lopinsjk for each url for all alternatives. Check out the example in the help center for clarification.
this is a great and very valuable information about this topic
@Christopher Semturs:
Oh my god! 60 links * 6 language = 360 alternate rel!
I have some work to do!!
Excellent. Before this I would have ended up with an english language page that has 117 alternate links for local versions due to pricing changes in different countries.
PHEW!
It was only last year in the month of December, Google announced annotations for websites that catered visitors from different countries and languages. The primary function of these annotations were to specify a constellate of equivalent web-pages that used to cater visitors from different corners of the world. These annotations were added using hreflang attribute of link tag of HTML on all the pages.
Now, that's an old story because based on the feedback of webmasters, Google this year is adding a support that helps in specifying annotations of rel-alternate-hreflang present in the XML site-maps. As per Google, utilizing these site-maps instead of link elements present in HTML will offer you benefits such as easy deployment and smaller page size to the websites. In short you don't have to code into every single page now! To see how it actually works and for more information you can visit the 'Google Webmaster Central Blog' yourself. What do you have to say about this guys? Will it make any huge difference for the website targeting users in different languages and countries?
Cheers
Maneet Puri
Google announces multilingual site annotation in Site-maps!
Hey Guys, Do you still remember Google announcing annotations for websites targeting users from different languages and countries, last year? These annotations served the main function of specifying a cluster of similar web pages that served users belonging to different nations. These annotations were implemented with the help of 'rel-alternate-hreflang' link present in the coding of every web page.
Now Google is adding a new support to specify these annotations of ' rel-alternate-hreflang' in the site-maps. Benefits of using this site-map instead of link element present in site code include a smaller page size and easy deployment. Above all you do not have to code the link into every web page now. To see how it actually works and for more information you can visit the 'Google Webmaster Central Blog' yourself. Isn't it great? What do you think guys, will it prove to be of great help for websites catering audience from different countries?
Cheers
Maneet Puri
Are there plans to support this across different ccTLDs?
@Jamie this works just across different ccTLDs. The example is limited to one TLD for simplicity.
Is there a way to do the same thing by using microformats? (shema.org, for example)
Since most of sites has links to the different languages versions, would be nice to tag them in order to provide this information about languages.
@Cris there are no plans to support other in-page annotations for this information in the near future.
I'm really glad for that new implementation.
This is what I suggested and asked for about 1 month ago:
https://productforums.google.com/d/topic/webmasters/P8uR4QTBy98/discussion
GREAT :)
What if I had two sites, one setup as a TLD, and the other as a subdomain. My main sitemap is at http://example.com/sitemap.xml, and subdomain for http://uk.example.com/sitemap.xml, do I add the loc tags for each "site" but add the alternates to both versions? IE:
for http://example.com/page.html:
http://example.com/page.html
and for http://uk.example.com/sitemap.xml
http://uk.example.com/page.html
@Kevin
the setup (domain + sub-domain) works just fine.
on http://example.com/page, you need the hreflang to http:/uk.example.com/page, and the same the other way round.
Hi, we have a separate sitemap for each set of language targetted pages. Would adding rel=hreflang tags for the non english targetted pages to the english sitemap mean that we would no longer need the other (non english) sitemaps? Or should we replicate all the sets across all the sitemaps?
@twiglet. Replicate all the sets on all sitemaps.
Web google suport forum
Hey?
It would be nice if Webmaster Tools provided more details about the Sitemaps that we submit. A human-readable version of our Sitemaps as Google sees them, if you will. A list of the URLs in them, along with their update frequencies, their different language versions, and so on. Right now, it's hard to tell if Google is understanding our Sitemaps as we intended.
Thank you..
Question for a country such as Canada, would I just have hreflang="fr-ca"?
Also why in the example is the "en" alternate listed after the "de" when you already have it listed as the ""?
Thank you :)
Canada would be fr-ca or en-ca, yes.
nice written
just out of curiosity, with the new markup, if you load the sitemap in the browser it will just output a cluttered list of URLs, rather than the "nice" output that i always have seen. however in GWT it seems that it's recognizing the correct number of urls..
what's the reason for i am seeing this weird layout? is it because the browsers cannot understand this yet??
thanks
Gabrio
Browsers are not made for rendering xml. A plain good text editor would be a good start. :-)
Are there plans to add those extensions in the XHTML namespace to an official new sitemaps.org schema which replaces Sitemap 0.90?
I am helping myself out locally here with a customized XSD for validation and wondered if there would be a common, "official" one at some point.
Hi,
How does this works if I have a "sub-folder" option rather than ccTLD?
For example
abc.com/de
abc.com/jp
Should I need to have sitemaps like?
abc.com/sitemap.xml
abc.com/de/sitemap.xml
And should have this annotations separately for both?
Thanks,
@infoxisi either separated sitemaps or one combined, both will work.
@Michael Kröll The option for extensions by itself are already part of the general schema. You should be able to validate by validating against both xsd-files (xhtml and sitemaps, in this example), it should work just fine.
Hi Christopher,
Implementing all these new annotations in Sitemap itself being respected by Google alone? Or by all other Search Engines too?
@infoxisi either separated sitemaps or one combined, both will work.
Hi Thanks. BTW, can you please tell where do I insert "changefreq" "priority" "lastmod" in the new sitemap?
Is this correct? And if I am adding like the following, for which URL Google will assign the values??
http://www.example.com/
weekly
1
Thanks a lot!
@ infoxisi your xml-example is not readable in the blog post comment
@ infoxisi I can't tell what other search engines are doing with that info. Based on the XSD and the sitemaps-specification in the worst case they should just ignore the additional information.
@Chris
Thanks for answering!
What I meant to ask was, should I insert "changefreq" "lastmod" "priority" right above "" in the new Sitemaps?
Best,
Chris....
I would very much appreciate if you could answer my following questions, too!
We have been using that "hreflang" element in all the pages as suggested by Google two years back.
1. Should I remove all that "hreflang" html page elements which was implemented till today?? Which I don't think possible where you have a website with 300K pages.
2. Is that suffice to add this new annotations in the Sitemap for only the new pages to be added? leaving aside the old pages?
Thanks a lot!
As for where to insert other tags: According to the XSD both above and below will work, I can't say what xml-parsers of other search companies are doing.
The sitemap-hreflang-tag is an addition to the html-tag (as announced in 2010). You can choose to use either, they provide the same data and are handled equally.
@Chris
Thanks )
The sitemap-hreflang-tag is an addition to the html-tag (as announced in 2010). You can choose to use either, they provide the same data and are handled equally.
1. So, It's up to the user whether to use the sitemap-hreflang or html-tag right?
2. Does the new sitemap-hreflang preferred over html-tag?
3. Can I use both where I cannot remove the html-tag? I mean as for the old pages let them have the html-tag, and as for the new pages let them have sitemap-hreflang.. Is that make any sense?! Being frank I am totally confused.
Thanks again for your patience in answering all my question!
Best,
Whether you use the sitemap or the html page is totally up to you, and both variations are equivalent. Please use whatever you feel more comfortable with. If you already went for the html-route and you are happy with it, there's no reason to change.
Is there a tutorial or a way to get this implemented into the Google XML Sitemaps wordpress plugin?
Thanks
@Ryan I'm not aware of any official Google Wordpress plugins.
Whichever plugin you are using, you need to ping the actual developer of that plugin to get new features.
Hi,
Just wanted to check if it works across a combination of ccTLDs and Sub folders?
example.com/de
example.co.uk
example.fr
Thanks,
@unknown yes, combinations work fine.
Hi Chris,
Should I have to include the "xhtml" part before each hreflang link section?
Thanks,
yes. But to be on the safe side, please simply validate this yourself in an xml-editor (or validator), the schema references are valid.
It so much like a canonical, So can I avoid from using 'rel=canonical' in pages when using this hreflang-sitemap?
Thanks,
@unknown that is a very confusing question, those two concepts don't represent the same intent.
Please come with your question and the example website to the webmaster support forum.
Chris
Thank you so much for answering all my questions.
Finally, Is that possible to have all these variations in a single XML sitemap? I mean to have this hreflang annotations for the pages that targets audience from other regions and as for the remaining pages that do not have a targeted audience just leave them as they are? old sitemap+new hreflang-sitemap = mine
Is that allowed too?
A BIG thanks!
again it's me :)
Let me try to explain my situation clearly below..
How do you serve English content to the English speakers in a non-English speaking region?
For instance, lets assume that I have an overview page at example.com/overview - This is a Generic page
I have translated pages in french targeting french audience in the sub-folder at example.com/fr where I have all the localized pages available. Apart from these pages, the remaining non-translated pages also available in example.com/fr targeting English audience in France.
Thus I have the same content available in the same website for the same audience but in different regions.
example.com/overview - English content targeting all over the countries except France
example.com/fr/overview - English content targeting English speakers in France
{url}
{loc}httpdot//exampledotcom/overview{/loc}
{xhtml:link rel="alternate" hreflang="fr" href="httpdot//exampledotcom/fr/overview" /}
{xhtml:link rel="alternate" hreflang="en" href="httpdot//exampledotcom/overview" /}
{/url}
{url}
Oops, sorry forgot to ask my question
If I do like the above,
Will get under duplicate content issues? Because the content is not even 0.1% translated.
Many thanks!
@unknown your question gets pretty specific to your site it seems, please bring it to the webmaster forum to get a good reply.
Chris,
Thanks. Yes I posted the same question two weeks before in the webmaster internationalization section, but yet to get a reply to my post!!!
{https://productforums.google.com/forum/#!category-topic/webmasters/internationalization/a3_gstnpXHM}
Hi,
The previous sitemap looked good when requested by a web browser. But after adding the new annotations, it just looks like a plain text without any rules. Is the fine?
Thanks,
Web Browsers are not a good way to verify an xml file. Please us a proper xml-editor with schema validation.
We want to have 4 e-commerce sites indexed. There is a lot of shared content because most of the products are the same but the trade site will have some additional products and customer information pages (delivery etc) will be different for trade and retail. Structure is as follows:
1. www.brand1.com Retail version
2. www.brand1.com/ie Retail version for Irish customers
3. www.brand1.com Trade version
4. www.brand2.com/ie Trade version for Irish customers
Putting rel="alternate" hreflang="x" in the sitemap looks as if it will handle our UK vs Irish pages. I think the same technique will work to prevent Google thinking we are supplying duplicate content. Can you confirm please?
Jo: Please bring your scenario to the support forum at http://productforums.google.com/forum/#!categories/webmasters/internationalization
Thanks,
Christopher
Dear still facing problems my posts are not showing googles Not working in search engine
Post a Comment