Configure a sitemap
Set up the sitemap for a site.
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 (underloc
) 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:
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, whereKEY
is name of your choice andVALUE
is a direct link to an external sitemap file. For example: http://example.com/sitemap.xmlIf 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.
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 therobots.txt
file.Publish the page to automatically update the sitemap.