Site icon Constellation for Sitecore

Foundation SitemapXml Supports Multi-Language

The Constellation.Foundation.SitemapXml library will now emit a multi-language sitemap.xml file according to Google’s spec on alternate language URLs in the sitemap.xml file.

To activate this feature, you need to tell the sitemap.xml generator which languages your site supports. You do this by configuring the desired <site/> element in your Sitecore config files.

Examples:

<site name=”headquarters” defaultLanguage=”en-US” supportedLanguages=”en-US,fr-CA,es-MX” … />
<site name=”contuso” defaultLanguage=”en” supportedLanguages=”en,da,de,es,fr,it,nl” … />

You can use the two-digit codes or the two-digit + country codes depending upon your Sitecore implementation’s support for regional dialects, but the language codes must match the Language definition Items you have installed in Sitecore.

We also strongly suggest that you enforce the inclusion of Language codes in all URLs for sites that require a multi-language sitemap.xml document, otherwise the URLs produced by link manager may be ambiguous. This will confuse the Google crawlers and have a negative impact on SEO.

Grab the Nuget package

NuGet package for Sitecore 10.1

NuGet package for Sitecore 10.2

Exit mobile version