# What is a Sitemap? How to Add sitemap.xml (2026)

> A sitemap is a list of public URLs you want search engines and AI crawlers to find. Learn what sitemap.xml is, what to include, and how Sabilytics checks for it.

- Canonical: https://www.sabilytics.com/blog/what-is-a-sitemap
- Markdown: https://www.sabilytics.com/blog/what-is-a-sitemap.md
- Author: Ayodele S. Adebayo (Founder, Sabilytics)
- Section: Search Discoverability (SEO)
- Published: 2026-08-14

A **sitemap** is a public file (usually `https://yourdomain.com/sitemap.xml`) that lists the pages you want crawlers to find. Search engines and many AI crawlers use it as a map when links alone would miss docs, pricing, or older posts.

It does not rank you. It does not replace clear titles or a crawlable `robots.txt`. It answers a prior question: can a bot discover the URLs you care about without guessing?

This guide covers what belongs in a sitemap, how to publish one, and how Sabilytics scores the sitemap check in [Search Discoverability](/blog/what-is-search-discoverability) and [AI Discoverability](/blog/what-is-ai-discoverability).

## TL;DR

- Publish `/sitemap.xml` with real, public, canonical URLs. Skip dashboards, drafts, and `noindex` pages.
- Point to it from `robots.txt` with a `Sitemap:` line so crawlers do not have to guess the path.
- A missing or unreachable sitemap is a common fail on both Sabilytics checks.
- Keep it updated when you add or remove pages. A stale map is worse than a short honest one.

## Why sitemaps exist

Crawlers start from links: homepage, nav, footer, internal posts. That works until it does not.

- A docs page only linked from an email
- A changelog with no inbound links
- A marketing site that ships new routes every week
- Pagination or tags that bury older URLs

A sitemap is you saying: here are the addresses that matter. Google, Bing, and assistant search bots can still ignore a URL, but they no longer have to stumble onto it.

## What a sitemap is (and is not)

**It is**

- An XML (or sitemap index) document at a stable URL
- A list of loc (the URL), and optionally lastmod, changefreq, and priority
- A hint, not a contract. Crawlers may fetch only some of the list.

**It is not**

- A ranking lever. Priority `1.0` on every URL does nothing useful.
- A substitute for [robots.txt](/blog/robots-txt-for-ai-crawlers). If you `Disallow: /`, the sitemap will not save you.
- A place to list private app routes, preview deploys, or pages you marked `noindex`.

If a page should not appear in search, leave it out of the sitemap and keep it out of the index. Do not list it and then ask engines to ignore it.

## A minimal sitemap.xml

```xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <lastmod>2026-08-14</lastmod>
  </url>
  <url>
    <loc>https://example.com/pricing</loc>
  </url>
  <url>
    <loc>https://example.com/blog/what-is-a-sitemap</loc>
    <lastmod>2026-08-14</lastmod>
  </url>
</urlset>
```

Rules that matter more than the optional tags:

1. Use absolute `https` URLs that match your canonical host (`www` or apex, not both).
2. Only include `200` pages you want discovered.
3. One URL per page. Do not list every query-string variant.
4. If the file grows past about 50,000 URLs, split it and publish a sitemap index.

In Next.js, `app/sitemap.ts` (or a framework plugin) can generate this on each deploy so you are not editing XML by hand.

## Point robots.txt at the file

Crawlers look for `/sitemap.xml` by habit. They also honor an explicit pointer:

```txt
User-agent: *
Allow: /

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

Sabilytics treats the sitemap as present if `/sitemap.xml` responds, or if the first `Sitemap:` URL in `robots.txt` is reachable. Either path works. Doing both is the usual, boring setup.

## What Sabilytics checks

On a Search or AI Discoverability scan:

1. Fetch `https://yourdomain.com/sitemap.xml`.
2. If that misses, fetch the first sitemap URL declared in `robots.txt`.
3. Pass when one of those responds. Fail when neither does.

The check is reachability, not a full XML audit. A 404, a login wall, or an HTML error page counts as missing. A valid file that only lists the homepage will pass the check and still leave most of your site unmapped. Fix the fail first, then make the list complete.

## Common reasons sites fail

### No file at all

Hand-rolled HTML, a static host, or a framework you never configured. The homepage works. The map does not exist.

### The file is behind auth or `noindex` habits

Preview headers, a global `robots: { index: false }`, or a sitemap route that only works locally.

### Wrong host

The sitemap lists `http://` or the non-canonical host. Crawlers fetch it, then have to reconcile duplicates. Pair the file with a homepage [canonical](/blog/what-is-search-discoverability).

### Stale leftovers

Old `/blog/draft` URLs, deleted landing pages, or staging paths. Trim them when you delete the page.

## How to add a sitemap

Do these in order. Re-scan after the deploy.

1. **List public routes** you want found: home, product, pricing, docs, published posts.
2. **Generate XML** with your framework, or start with the minimal file above.
3. **Serve it at `/sitemap.xml`** (or another URL you will keep stable).
4. **Add a `Sitemap:` line** to `robots.txt`.
5. **Confirm in a private window** that the URL returns XML, not a 404 page.
6. **Re-run** [Search Discoverability](/search-discoverability) and [AI Discoverability](/ai-discoverability).

If you use Sabilytics, a missing sitemap shows up as its own finding with a fix hint you can paste into a coding assistant.

## Common myths

**"Google will find everything through links."**  
Often, for a small tightly linked site. Docs, older posts, and thin nav sites still go missing. A sitemap is cheap insurance.

**"A sitemap guarantees indexation."**  
No. It offers URLs. Indexation still depends on quality, crawl access, and whether you blocked the page.

**"I need changefreq and priority on every URL."**  
`lastmod` when you have a real date is enough. Fake daily changefreq trains crawlers to ignore you.

**"AI assistants do not use sitemaps."**  
Assistant search still depends on crawlable URLs. The same file helps both checks. [`llms.txt`](/blog/what-is-llms-txt) is a briefing, not a URL list.

## Frequently asked questions

### HTML sitemap vs XML sitemap?

An HTML sitemap is a page of links for humans. Useful. It is not a substitute for `sitemap.xml`. Sabilytics looks for the machine-readable file.

### Should I include images or video sitemaps?

Only if those assets are a product you want discovered on their own. Most marketing sites need a URL sitemap first.

### What about Next.js `sitemap.ts`?

That is the right default on the App Router. Export absolute URLs, include published blog slugs, and keep private app routes out.

### Do I submit the sitemap in Search Console?

Yes, when you use Console. The file should still be public and referenced from robots even if you never open Console. Sabilytics does not replace that submission.

### Where should I start if I am overwhelmed?

One file, homepage plus your five most important URLs, plus a `Sitemap:` line. Re-scan. Expand the list next.

## Check whether crawlers can find your map

Reading the format is useful. Seeing a miss on your domain is better.

Sabilytics looks for `/sitemap.xml` or a sitemap declared in `robots.txt`, next to the rest of the Search Discoverability checklist.

When you are ready, [run a free Search Discoverability check](/search-discoverability) on your domain.
