Configure a sitemap

Current version: 1.5

Sitemaps help search engine crawlers navigate your site and improve search engine optimization (SEO). With SXA, by default the sitemap is generated for the whole site and stored in cache. An XML sitemap is created specifically for search engines to show details of the available pages in a website, their relative importance, and the frequency of content updates.

By default, the sitemap uses the Host Name defined in the Basic section in the Settings item of your site (site/Settings). If both the Host Name and the TargetHostName fields are empty, the sitemap returns a 404 error.

This sitemap file is stored in the root folder of your server, and is usually named sitemap.xml.

Every entry in the sitemap contains the following attributes:

  • Loc – the location of the page.

  • Lastmod – the date when the page (under loc) was last modified.

  • Changefreq – how often the page changes its content.

  • Priority – number between 0 and 1 that represents the importance of specific page.

To configure the sitemap for your site:

  1. In the Content Editor, navigate to site/Settings and in the Search Engines Sitemap section, in the Sitemap Mode field, select the storage option for the sitemap.

    • Inactive – turns the sitemap off.

    • Stored in cache – stores the sitemap for the whole site in cache. Select this option if your site is hosted on an environment such as Azure and you cannot easily store files on a drive, or if your site is very dynamic and you need to re-generate the sitemap almost every time it is requested. This option is turned on by default.

    • Stored in file – stores the sitemap for the whole site in file. Select this option if you have a large site that does not change frequently.

    Optionally, you can reference external sitemaps in the generated index file by adding the sitemap in [KEY][VALUE] format, where KEY is name of your choice and VALUE is a direct link to an external sitemap file. For example:

  2. If you want to reference the external sitemaps in a sitemap index file, select the Create sitemap index instead of sitemap check box. This can be useful if you host external sites such as a WordPress blog on your site.

  3. Save the settings and publish the item. Once the settings are saved, you can find the sitemap here: TargetHostName/sitemap.xml. A link to the sitemap is automatically added at the end of the robots.txt file.

  4. Publish the page to automatically update the sitemap.

Do you have some feedback for us?

If you have suggestions for improving this article,