# XML sitemap

> Giving crawlers a reliable map of the pages you want AI to cite.

By Joey Kudish · Reviewed by Marius C. Paun · Published 2026-07-27 · Updated 2026-07-28

A sitemap is the simplest possible favor you can do a crawler: a plain list of the pages you want it to know about. No guessing, and no relying on the crawler to follow every internal link to find them all.

## What it is

An XML sitemap is a file that lists your important URLs in a standard format defined by [sitemaps.org](https://www.sitemaps.org/protocol.html). Every major engine reads it. Each entry has a location, and optionally the date it was last changed.

## Why AI engines care

Crawlers find pages by following links, but a sitemap is a direct, reliable index that does not depend on your internal linking being perfect. For the pages you most want pulled into AI answers, your services, your proof, your buyer-question pages, a sitemap makes sure they are on the crawler's radar. Paired with an accurate last-modified date, it also signals which pages are fresh, which feeds the [content freshness](/guides/date-modified) signal.

## How to set it up

A minimal sitemap is just a `urlset` with one `url` block per page:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.com/</loc>
    <lastmod>2026-06-28</lastmod>
  </url>
  <url>
    <loc>https://www.example.com/services/</loc>
    <lastmod>2026-06-15</lastmod>
  </url>
</urlset>
```

Then point crawlers to it from your `robots.txt`:

```
Sitemap: https://www.example.com/sitemap.xml
```

Most platforms (WordPress, Shopify, Astro, Next.js) can generate and keep the sitemap current for you, which is the right way to do it, since a stale sitemap is worse than none. Submit it once in Google Search Console and Bing Webmaster Tools too.

If you have a large site, mind the limits: a single sitemap file caps at 50,000 URLs and 50MB uncompressed. Past that, split it and use a sitemap index file that lists each one:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://www.example.com/sitemap-pages.xml</loc>
    <lastmod>2026-06-28</lastmod>
  </sitemap>
</sitemapindex>
```

## Skip priority and changefreq

The format allows `<priority>` and `<changefreq>` tags, but do not bother tuning them: Google has stated plainly that it ignores both, and Bing discounts them too. The one optional field that earns its keep is `<lastmod>`, and only if it is accurate. Google uses it when it can verify it matches the page's real last change. Stamp every page with today's date and the engines learn to ignore your `lastmod` entirely. Keep it accurate and it stays useful.