---
title: "Configure a sitemap"
slug: "configure-a-sitemap"
abstract: "Set up the sitemap for a site."
---
# Configure a sitemap

Sitemaps help search engine crawlers navigate your site and improve search engine optimization (SEO). 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.

In the sitemap, each page is represented by a `URL` element.

> [!note]
> By default, the sitemap uses the Host Name defined in the Basic section in the site host item of your site (`<site collection>/<site>/Settings/Site Grouping/Site)`. If both the Host Name and the TargetHostName fields are empty, the sitemap returns a 404 error.
>
> To ensure that the sitemap link is generated properly, you must configure the target hostname and scheme on the site host item.

To configure the sitemap for your site:

1. In the Content Editor, navigate to <site>/Settings/Sitemap.
2. Fill in the following fields:
- Tab: Field
- Alternate links: Generate alternate links
- Include x-default: Select to add the xhtml:link element with hreflang set to x-default to the URL element. The x-default value signals to the search algorithm that the page does not target any specific language or region.Example:

```text
<xhtml:link rel="alternate" hreflang="x-default" href="https://sxa" />

```

- hreflang: Specify language and region options for the hreflang attribute:with language and region - URLs are rendered both for region dependent and independent codes. Example:with region only - URLs are rendered only for region dependent codes. Example:with language only - URLs are rendered only region independent codes. Example:

```xml
<xhtml:link rel="alternate" hreflang="en" href="https://sxa/en" />
<xhtml:link rel="alternate" hreflang="en-US" href="https://sxa/en-US" />
<xhtml:link rel="alternate" hreflang="en-CA" href="https://sxa/en-CA" />

```
```xml
<xhtml:link rel="alternate" hreflang="en-US" href="https://sxa/en-US" />
<xhtml:link rel="alternate" hreflang="en-CA" href="https://sxa/en-CA" />

```
```xml
<xhtml:link rel="alternate" hreflang="en" href="https://sxa/en" />
<xhtml:link rel="alternate" hreflang="da" href="https://sxa/da" />

```

- Urlset attributes: lastmod
- changefreq: Select to render the `changefreq` attribute that belongs to the `URL` element. Specifies how often the page changes its content.
- priority: Select to render the `priority` attribute that belongs to the `URL` element. Specifies a number between 0 and 1 that represents the importance of a specific page.
- URL options: Link provider name
- Content crawling: Crawler
- Cache: Refresh threshold
- Cache Type: Specify how the sitemap is stored:**Inactive** - turns the sitemap off.**Stored in cache** - stores the sitemap for the whole site in the 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 have 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 a file. Select this option if you have a large site that does not change frequently.
- Cache Type: **Cache Expiration** - Specify in minutes the lifetime of the sitemap in the `HttpRuntime.Cache` property.
- Sitemap index: Maximum number of pages per sitemap
- Media items: Generate sitemap media items