Search engine optimization (SEO) is a key aspect to keep in mind when building a multilingual site. One of the basic SEO practices is building a sitemap. In this blog entry, we will cover the main aspects to consider when building a multilingual Sitecore sitemap. We will cover some generic aspects that apply to any multilingual website and then we will speak about some tips specifically related to Sitecore multilingual websites.
Sitemaps for Multilingual Websites
A sitemap helps search engine crawlers navigate your website and improve SEO. Typically, it’s an XML file called sitemap.xml, which is stored in the root folder of your domain.
For multilingual websites, you can use the sitemap to tell the search engine all the languages and regions for each URL. To do this, the sitemap should include a <url> element and, inside of it, a <loc> element specifying the source (typically English) URL and <xhtml:link> entries for every language and locale of the page.
In the example above, I specified the localized pages for Arabic (ar), Spanish (es) and Chinese (zh). Note that I only specified languages, but you can also identify a region, for example Spanish Argentina would be es-AR.
For more information on this topic, you can refer to this entry in the Google Support pages.
Building a Multilingual Sitecore Sitemap
Now, let’s talk about how to create a multilingual Sitecore sitemap.
If you are using Sitecore Experience Accelerator (SXA), which is present in the latest Sitecore versions (starting from 9.3), then the sitemap will be generated automatically for each site and will be stored in cache. For more details about this, you can check the following link.
For older versions (prior to 9.3), you can build the sitemap.xml manually or you can use a module. Building a sitemap.xml manually will take more effort, but you can customize it and improve it based on your needs. If you decide to go for a module, then you can consider the following ones:
- Ultimate Sitemap XML
- Multilingual XML Sitemap: This is an extension of Ultimate Sitemap XML and includes multilingual support.
- Sitecore Advanced Sitemap Module: This supports multilingual sites.
- Sitemap Generation
Another option would be to build your own custom module to generate your sitemap.xml file.
When creating a multilingual Sitecore sitemap, going for a manual or an automated approach to generate the sitemap.xml will depend on the current size of your site and its expected growth. If your website has a number of pages that can be managed by creating a sitemap.xml manually, then I would recommend you go for this option. Otherwise, I would recommend you test the available modules or consider building a custom one if none of the available options work for you.