List your indexable URLs in a sitemaps.org file, publish it at /sitemap.xml, add it to robots.txt and submit it in Search Console.

Collage of two hands unfolding a paper map with pins on a yellow background

To create an XML sitemap, list the canonical, indexable URLs you want Google to find in a file that follows the sitemaps.org format, publish it on your site (usually at /sitemap.xml), then submit it in Google Search Console and reference it in robots.txt. Most content management systems and SEO plugins will generate and update the file for you.

An XML sitemap is a list of the pages on your site that you’d like search engines to crawl. It doesn’t guarantee indexing, and it doesn’t replace good internal linking. What it does is help Google discover new and updated pages faster, especially on large sites, new sites with few links, or sites where some pages sit deep in the structure.

The file itself is simple. The skill is in deciding what goes into it and keeping it accurate as the site changes.

What an XML sitemap looks like

A basic sitemap is a short block of XML with one entry per URL:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.co.uk/services/</loc>
    <lastmod>2026-09-01</lastmod>
  </url>
  <url>
    <loc>https://www.example.co.uk/blog/new-post/</loc>
    <lastmod>2026-09-08</lastmod>
  </url>
</urlset>

The loc tag holds the full, absolute URL. The lastmod tag holds the date the page’s main content last changed. The protocol also allows priority and changefreq tags, but Google ignores both, so there’s no need to spend time on them.

How to create an XML sitemap, step by step

  1. Check whether you already have one. Try yourdomain.com/sitemap.xml, /sitemap_index.xml and /wp-sitemap.xml, and look for a Sitemap line in your robots.txt file. WordPress, Shopify, Wix and Squarespace all create one by default.
  2. Pick your generator. On WordPress, Yoast SEO and Rank Math build sitemaps automatically and keep them updated. On a custom site, ask your developer to generate the file from the database so it changes when pages change. For a small static site, a crawler such as Screaming Frog can export one.
  3. Decide what to include. Only include URLs that return a 200 status, are self-canonical and are not set to noindex. Leave out redirects, error pages, duplicates, parameter URLs, thin tag archives and internal search results.
  4. Split large sites. A single sitemap can hold up to 50,000 URLs or 50MB uncompressed. Bigger sites need several sitemaps listed in a sitemap index file. Splitting by type (pages, posts, products, categories) also makes reporting easier.
  5. Use accurate lastmod dates. Google uses lastmod when it’s consistently accurate. Update it only when the main content changes, not every time the footer or a widget changes.
  6. Publish it at the root. Put the file on the same domain and protocol as the URLs it lists, ideally at the root so it can cover the whole site.
  7. Add it to robots.txt. Add a line such as Sitemap: https://www.example.co.uk/sitemap.xml. This lets any crawler find it.
  8. Submit it in Search Console. Go to Sitemaps, enter the URL and submit. Search Console then reports whether Google could read it and how many URLs it found.

Google retired its old sitemap ping endpoint in 2023, so pinging a URL to announce updates no longer does anything. Accurate lastmod dates and a sitemap that Google already knows about do that job instead.

What to leave out of your sitemap

A sitemap is a signal about which pages matter. Filling it with URLs you don’t want indexed sends mixed messages and makes the Search Console reports harder to read. Leave out:

  • Pages set to noindex, or blocked in robots.txt.
  • URLs that redirect or return 404 or 410.
  • Non-canonical versions, such as tracking parameters, sort orders or printer-friendly copies.
  • Staging or development URLs.
  • Thin pages such as empty tag archives or author pages with no content.

Each URL left in the sitemap should be one you’d be happy to see in search results. If you’re unsure whether a page can be indexed at all, our guide to indexability explains what to check.

Special sitemaps for images, video and news

Google supports extensions for images, video and news. Image entries can help Google find images loaded in ways it might otherwise miss. Video sitemaps can add details such as duration and thumbnail. News sitemaps are for publishers in Google News and should only list articles from the last two days. Most business sites only need a standard sitemap, as long as images use normal img tags in the HTML.

How to check your sitemap is working

Open the Sitemaps report in Search Console. A status of Success means Google read the file. Then open the Page indexing report and filter by your sitemap to compare what you submitted with what Google indexed.

Big gaps between the two are worth digging into. Common causes are duplicate content, thin pages, canonical tags pointing elsewhere, or pages Google has crawled but chosen not to index. Running a crawl of the URLs in the sitemap and checking their status codes, canonicals and robots tags will usually show the problem. Our guide on how to do a site crawl explains how.

Sitemaps are one of the first things we check in any SEO audit, because a messy one is often the first sign of wider crawl and indexing problems. Book a free strategy session and we’ll look at yours.

Related reading: our guides to technical SEO and JavaScript SEO.

Common questions

Do I need an XML sitemap?

Small sites with good internal linking can be found without one, but a sitemap costs almost nothing and helps Google find new pages faster. Large sites, new sites and sites with lots of media benefit most.

How many URLs can go in one sitemap?

Up to 50,000 URLs or 50MB uncompressed, whichever comes first. For bigger sites, split the URLs across several sitemaps and list them in a sitemap index file.

Does a sitemap guarantee my pages will be indexed?

No. A sitemap helps Google discover URLs, but Google still decides whether each page is worth indexing based on its quality, uniqueness and technical signals.

How often should I update my sitemap?

Every time you add, remove or meaningfully change a page. The easiest way is to use a plugin or system that rebuilds the sitemap automatically, so it never falls out of date.

Danny DaleyFave songThunderstruckAC/DC · The Razors Edge, 1990

Danny is the founder and Director of Search at Circulate Digital, with over 15 years in SEO and CRO. He has led search strategy for organisations including the NHS, Octopus and TUI, pairing deep technical expertise with a clear view of what moves revenue. At Circulate he sets client strategy and agency direction, and still reads the work.FromBrightonBased inSheffieldStudiedDigital Media degreeProudest campaignOctopusHostsBorn to be Found