2

Is there a way to specify the language of a URL in an XML sitemap? I'm not talking about alternate URL's, I'm talking about the case where for example a mostly english site has a page that only exists in German - i.e. there is no alternate URL's.

For example, let's say I have some multilingual pages

<url>
  <loc>http://example.com/eng/page1</loc>
  <xhtml:link rel="alternate" hreflang="en" href="http://example.com/eng/page1"/>
  <xhtml:link rel="alternate" hreflang="de" href="http://example.com/ger/page1"/>
</url>
<url>
  <loc>http://example.com/eng/page2</loc>
  <xhtml:link rel="alternate" hreflang="en" href="http://example.com/eng/page2"/>
  <xhtml:link rel="alternate" hreflang="de" href="http://example.com/ger/page2"/>
</url>
<url>
  <loc>http://example.com/eng/page3</loc>
  <xhtml:link rel="alternate" hreflang="en" href="http://example.com/eng/page3"/>
  <xhtml:link rel="alternate" hreflang="de" href="http://example.com/ger/page3"/>
</url>

And then there is this one page that only exists in german and doesn't have any corresponding english page

<url>
  <loc>http://example.com/ger/unique-german-page</loc>
</url>

The search bots will probably be able to figure out which language the content is, but it seems like there should be a way to specify it directly in the sitemap.

Should I do something like this?

<url>
  <loc>http://example.com/ger/unique-german-page</loc>
  <xhtml:link rel="alternate" hreflang="de" href="http://example.com/ger/unique-german-page"/>
</url>
Machavity
  • 30,841
  • 27
  • 92
  • 100
Magnus
  • 17,157
  • 19
  • 104
  • 189

0 Answers0