2

We have websites with multilingual content.

e.g.

  • http://www.example.com/about-us/
  • http://www.example.com/en-HK/about-us/
  • http://www.example.com/en-GB/about-us/
  • http://www.example.com/zn-CH/about-us/

We need to configure the hreflang tags in sitemap for Google to know that there are alternate links for the same pages in different languages.

I know for the above example that my sitemap URL tag would look like this:

  <url>
    <loc>http://www.example.com/about-us</loc>
    <xhtml:link rel="alternate" hreflang="en-GB" href="http://www.example.com/en-GB/about-us"/>
    <xhtml:link rel="alternate" hreflang="en-HK" href="http://www.example.com/en-HK/about-us"/>
    <xhtml:link rel="alternate" hreflang="zn-CH" href="http://www.example.com/zn-CH/about-us"/>
    <changefreq>daily</changefreq>
    <priority>0.8</priority>
  </url>

However, if I don't have the main URL but just the last three ones with en-HK, en-GB and zn-CH, then how should my URL tag look? Should I just skip the loc tag and keep the three xhtml:link tags? Or can I specify any URL in the loc tag and put the remaining two in xhtml:link tags?

I am new to Google sitemaps. Any help is greatly appreciated.

Thanks, Rashmi

Edit: From the answer posted on https://stackoverflow.com/questions/18423624/sitemap-for-domain-with-multilanguage-site/18423803#18423803, for my example with sites in en-HK, en-GB and zn-CH, should there be three URL tags, with each of them assigned to loc with the other two in xhtml:link?

4

Ok. Found the answer at:

Help Google serve the correct language to your visitors

We need to have a url tag for each of the url and specify the others as alternate urls.

0

In terms of SEO, according to Yoast, you should include all the pages in your list of alternate links, like so:

<url>
  <loc>http://www.example.com/about-us</loc>
  <xhtml:link rel="alternate" hreflang="en" href="http://www.example.com/about-us"/>
  <xhtml:link rel="alternate" hreflang="en-GB" href="http://www.example.com/en-GB/about-us"/>
  <xhtml:link rel="alternate" hreflang="en-HK" href="http://www.example.com/en-HK/about-us"/>
  <xhtml:link rel="alternate" hreflang="zh-CN" href="http://www.example.com/zh-CN/about-us"/>
  <xhtml:link rel="alternate" hreflang="x-default" href="http://www.example.com/about-us"/>
  <changefreq>daily</changefreq>
  <priority>0.8</priority>
</url>

(Note: I assume your default page is "en-US", but I do not specify the "US" on purpose.)

And as you're at it, you could include an x-default line as well.

Further, the languages which are not alternative of the same language should not include the region. So I would replace the "zh-CN" with "zh" (Chinese is zh, I'm not sure what zn-CH would be?). That way, if you are not specifically in China but still want to read Chinese, you get the "zh" page which should work for you (more or less. I know Chinese vary quite a bit between regions, contrary to French or English, which differences are often just in spelling or choice of words.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.