大网数据广告活动
网站运营与故障问答

Sitemap best practice for multilingual website - Should I list my urls in each language or is the use of rel=“alternate” + hreflang enough?

· 52CE 我爱测

I'm working on the sitemaps of a multilingual website and I have a doubt regarding the best practice for referencing each language version of a page. For a bit of background, the website references around 20 000 places with comme…

问题原文

原帖链接 · EdouardF · CC BY-SA 4.0

I'm working on the sitemaps of a multilingual website and I have a doubt regarding the best practice for referencing each language version of a page.

For a bit of background, the website references around 20 000 places with comments from the community and descriptions. The website is available in 5 languages (website.com/fr; website.com/it...)

For the moment, my sitemap only references english pages and in the sitemap for each page I specify <xhtml:link rel="alternate" hreflang="en" href="URL"/> for each language (as well as English) as Google recommends.

In the Google Search Console, I see that about 75% of the pages with valid coverage are described as "indexed, not submitted in Sitemap" which makes me think that the alternate link with hreflang attribute is not enough to "submit" the page for google to index it.

Do I need to list the pages in all 5 languages in my sitemap and use as well <xhtml:link rel="alternate" hreflang="en"... on each link?

已采纳解答

原帖链接 · Evgeniy · CC BY-SA 4.0

Just to begin a question: do you have certain Search Console properties for each language? If not - consider to establish.

According to my experience it should be enough to have such setup as you have it - one sitemap with all hreflangs. But such setups are pretty error-prone. There are many factors influencing 100% retrieving of sitemap urls - it is not possible to make a remote diagnose for this issue. Maybe you attach your sitemap to make it easier.

But i'll do the first try. According to your question, "Do I need to list the pages in all 5 languages in my sitemap", it seems, that you list in your sitemap only your english urls with corresponding hreflang urls. Like this:

  <url>
    <loc>http://www.example.com/english/page1.html</loc>
    <xhtml:link 
               rel="alternate"
               hreflang="de"
               href="http://www.example.com/deutsch/page1.html"/>
    <xhtml:link 
               rel="alternate"
               hreflang="de-ch"
               href="http://www.example.com/schweiz-deutsch/page1.html"/>
    <xhtml:link 
               rel="alternate"
               hreflang="en"
               href="http://www.example.com/english/page1.html"/>
  </url>
  <url>

    <url>
    <loc>http://www.example.com/english/page2.html</loc>
    <xhtml:link 
               rel="alternate"
               hreflang="de"
               href="http://www.example.com/deutsch/page2.html"/>
    <xhtml:link 
               rel="alternate"
               hreflang="de-ch"
               href="http://www.example.com/schweiz-deutsch/page2.html"/>
    <xhtml:link 
               rel="alternate"
               hreflang="en"
               href="http://www.example.com/english/page2.html"/>
  </url>
  <url>

But, according to Google, one should list ALL urls in this sitemap - means, if you list an english page as <loc></loc> with corresponding german hreflang url, so you should list the german url as <loc></loc> too, with corresponding english hreflang url. So, if you have three different language urls, you should have in the sitemap three <url></url> blocks, like this:

  <url>
    <loc>http://www.example.com/english/page1.html</loc>
    <xhtml:link 
               rel="alternate"
               hreflang="de"
               href="http://www.example.com/deutsch/page1.html"/>
    <xhtml:link 
               rel="alternate"
               hreflang="de-ch"
               href="http://www.example.com/schweiz-deutsch/page1.html"/>
    <xhtml:link 
               rel="alternate"
               hreflang="en"
               href="http://www.example.com/english/page1.html"/>
  </url>

    <url>
    <loc>http://www.example.com/deutsch/page1.html</loc>
    <xhtml:link 
               rel="alternate"
               hreflang="de"
               href="http://www.example.com/deutsch/page1.html"/>
    <xhtml:link 
               rel="alternate"
               hreflang="de-ch"
               href="http://www.example.com/schweiz-deutsch/page1.html"/>
    <xhtml:link 
               rel="alternate"
               hreflang="en"
               href="http://www.example.com/english/page1.html"/>
  </url>

    <url>
    <loc>http://www.example.com/schweiz-deutsch/page1.html</loc>
    <xhtml:link 
               rel="alternate"
               hreflang="de"
               href="http://www.example.com/deutsch/page1.html"/>
    <xhtml:link 
               rel="alternate"
               hreflang="de-ch"
               href="http://www.example.com/schweiz-deutsch/page1.html"/>
    <xhtml:link 
               rel="alternate"
               hreflang="en"
               href="http://www.example.com/english/page1.html"/>
  </url>

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2019-09-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。