---
title: "Configure a sitemap"
slug: "configure-a-sitemap-1188148"
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, SXA uses the Target hostname in the Basic section of the site definition item when generating sitemap URLs. If this field is empty, SXA uses Host name when it contains a single explicit hostname. SXA falls back to the host in the current request if Host name:
> - Is blank.
> - Contains  `*`.
> - Contains multiple hostnames.
> 
> When no request host is available,  SXA falls back to the the host configured in  `Globals.ServerUrl`. An empty Target hostname and Host name do not by themselves cause the sitemap to return a 404 error.
>
>To make sitemap URLs use the intended public host and protocol, configure Target hostname and Scheme on the site definition item at `<site collection>/<site>/Settings/Site Grouping/Site`.

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