Technical SEO

What is a sitemap?

Short answer

An XML sitemap is a file that lists the URLs you want search engines to index, usually at yoursite.com/sitemap.xml. It helps Google discover pages faster, especially on large sites or pages with few internal links.

Sitemap, defined

A sitemap is a file that lists the URLs on your website you want search engines to find. The most common type is an XML sitemap, usually at yoursite.com/sitemap.xml. It gives Google, Bing and other crawlers a direct list of your pages, so they don't have to discover everything by following links.

There are also HTML sitemaps, which are regular pages listing links for people. They were common on older sites; today XML sitemaps matter much more for SEO.

What's inside an XML sitemap

Each URL is listed inside a url entry with a few possible fields:

  • loc: the full URL of the page. Required.
  • lastmod: when the page last changed meaningfully. Google uses this if it's consistently accurate.
  • changefreq and priority: older fields. Google has said it ignores them.

Sitemaps can also include image, video and news extensions, and hreflang annotations for multilingual sites.

Limits and sitemap indexes

A single sitemap file can contain up to 50,000 URLs and be up to 50 MB uncompressed. Larger sites split their URLs across several sitemaps and list them in a sitemap index file.

Splitting by type (pages, blog posts, product pages, programmatic pages) also makes it easier to see indexing problems for each section in Google Search Console.

Do you need a sitemap?

Google says sitemaps are most useful when:

  • Your site is large, so crawlers may miss new or updated pages.
  • Your site is new and has few external links pointing to it.
  • Pages aren't well linked internally.
  • You publish a lot of new content, or change content often.
  • You have rich media like videos and images you want indexed.

A small, well-linked site may be fully crawled without one. But a sitemap costs nothing to add, and almost every CMS generates one automatically, so there's rarely a reason not to have one.

What a sitemap does and doesn't do

A sitemap helps search engines discover pages and notice changes. It doesn't guarantee indexing or improve rankings. Google still decides whether each page is worth indexing based on its quality and whether it duplicates other pages.

Think of it as a strong hint about which URLs you consider important and canonical.

Sitemap best practices

  1. Only list URLs you want indexed. Each one should return a 200 status, be canonical, and not have a noindex tag.
  2. Leave out redirects, 404s and duplicates. A sitemap full of errors makes Google trust it less.
  3. Keep lastmod honest. Update it when content changes meaningfully, not every time the page is regenerated.
  4. Update automatically. New pages should appear and deleted pages disappear without manual work.
  5. Use absolute URLs with the correct protocol and domain version.
  6. Submit it in Search Console and Bing Webmaster Tools, and list it in your robots.txt with a Sitemap: line.
  7. Split large sites into logical sitemaps for easier monitoring.

Common sitemap mistakes

  • Listing every URL the CMS knows about, including tag pages, filtered views and test pages.
  • Including URLs that canonicalize to other URLs, which sends mixed signals. See canonical tags.
  • Forgetting to update the sitemap after a migration, leaving old URLs that now redirect.
  • Blocking the sitemap itself in robots.txt.
  • Setting every lastmod to today's date, which makes the field useless.
  • Having several conflicting sitemaps from plugins that were installed and forgotten.

How to check your sitemap

  1. Open yoursite.com/sitemap.xml (or check robots.txt for its location).
  2. In Search Console, open the Sitemaps report to see whether it was read successfully and how many URLs were discovered.
  3. Use the page indexing report, filtered by sitemap, to see which listed URLs are indexed and why others aren't.
  4. Crawl the sitemap with a tool like Screaming Frog to find non-200 URLs, noindexed pages and non-canonical URLs.

A big gap between submitted and indexed URLs is a signal worth investigating. It often points to thin or duplicate content rather than a sitemap problem. That's a common finding in an SEO audit.

Sitemaps for large and programmatic sites

If you generate thousands of pages from data, as in programmatic SEO, sitemaps become an important control tool. Split them by template, add pages gradually rather than all at once, and watch how each sitemap's indexing rate develops.

If Google indexes only a small share of a template, improve that template before adding more. The post on programmatic SEO without thin pages covers this.

On large sites, sitemaps also help with crawl budget, as I explain in crawl budget for SaaS sites.

Bing uses sitemaps and the IndexNow protocol to discover fresh content, and Bing's index feeds several AI assistants. Keeping sitemaps accurate helps new content reach those systems sooner, which supports AI search visibility.

Bottom line

A sitemap is a simple, cheap way to tell search engines which pages matter. Keep it clean, automatic and limited to indexable URLs, submit it, and check the reports now and then. If yours is a mess, it's usually a sign of broader technical SEO issues worth fixing.

Answered by Federico Martinez, SEO & AI Search Strategist · 4 min read. See all SEO questions

Want this sorted for your site?

Tell me what you're working on and I'll suggest a plan.

Federico Martinez

Related questions