Home / Learn / What is a sitemap.xml — and does your site need one?
SEO basics

What is a sitemap.xml — and does your site need one?

Short answer: A sitemap.xml is a file on your website that lists every page you want search engines to know about, in a machine-readable format. It acts as a table of contents for crawlers like Googlebot: instead of hoping they discover each page by following links, you hand them the complete list — along with hints like when each page last changed. Nearly every website benefits from one, and for new sites, large sites, or sites whose pages aren't well linked to each other, it makes a real difference in how quickly content gets indexed.

The name is literal: a map of your site. But it's worth being precise about what it does and doesn't do, because a sitemap is often the first thing an SEO checklist asks about — and one of the most misunderstood.

What does a sitemap actually do?

Search engines find pages mainly by crawling: they fetch a page, follow its links, fetch those pages, follow their links, and so on. That works well for pages that are well connected. It works poorly for pages that are new, deeply buried, or barely linked — a fresh blog post, a page only reachable from a menu that's rendered by JavaScript, a section nothing else points to.

A sitemap closes that gap. It tells crawlers directly:

  • Which pages exist — the full list of URLs you consider worth indexing.
  • When each page last changed (the lastmod field) — so crawlers can prioritize revisiting pages that actually changed instead of re-crawling everything blindly.
  • Roughly how pages relate in importance (the optional priority field) — a weak hint that some pages matter more than others.

What a sitemap doesn't do is just as important: it doesn't guarantee indexing, it doesn't improve rankings by itself, and it doesn't override anything. Google treats it as a hint, not a command. A page in your sitemap can still be skipped; a page missing from it can still be found through links.

What does a sitemap look like?

It's a plain XML file, usually at yourdomain.com/sitemap.xml. A minimal entry looks like this:

<url>
  <loc>https://example.com/services</loc>
  <lastmod>2026-07-01</lastmod>
</url>

One <url> block per page. You can look at yours right now: type your domain followed by /sitemap.xml into your browser. If you get a page full of structured text listing your URLs, you have one. If you get a 404, you don't — or it lives at a non-standard address declared in your robots.txt.

What belongs in it (and what doesn't)?

In: every page you'd want someone to land on from a search result — your homepage, service pages, blog posts, location pages, in every language you publish.

Out: pages that shouldn't appear in search results. Thank-you pages, internal search results, login pages, cart pages, duplicate URL variants, and legal boilerplate (a privacy policy ranks for nothing and dilutes the signal). A sitemap full of junk URLs makes the useful hints weaker.

Two rules matter more than the rest:

  1. Only canonical, working URLs. Every URL in the sitemap should return the page itself — not a redirect, not an error. Sitemaps full of redirecting or broken URLs teach crawlers to trust yours less.
  2. Keep it automatically up to date. A sitemap maintained by hand goes stale the day someone forgets to update it. It should be generated from the site's actual content, so a new page appears in it the moment the page goes live. (This is how ShiftPress sites work — the sitemap regenerates on every publish, so it can't drift out of sync.)

How do search engines find your sitemap?

Two ways, and you should use both:

  • Declare it in robots.txt — a line like Sitemap: https://example.com/sitemap.xml in the small text file at your domain root that every crawler reads first.
  • Submit it in Google Search Console (and Bing Webmaster Tools). This is more than a submission: Search Console then reports how many of the sitemap's pages were actually indexed, and why others weren't — one of the most useful free SEO diagnostics there is.

After a site migration, resubmitting the sitemap is one of the first things to do: it tells Google to come look at the new structure right away rather than waiting for a routine crawl.

Frequently asked questions

Does a sitemap improve my Google rankings?

Not directly. A sitemap affects discovery — whether and how quickly search engines find your pages — not how those pages rank once found. But a page that's never indexed can't rank at all, so for new or poorly-linked pages the practical effect can be dramatic.

My site is small. Do I still need one?

A ten-page site with a clear menu will get crawled fine without one — but there's no downside, and the lastmod hints still help changed pages get recrawled sooner. Since every serious platform generates one automatically, the real question is rarely whether to have one but whether yours stays accurate on its own.

Do I need to update my sitemap when I change a page?

You shouldn't have to do anything by hand — that's the point. On a well-built site the sitemap is regenerated automatically whenever content changes, updating the page's lastmod date. If your setup requires manually editing the sitemap, that's the thing to fix.

What's the difference between a sitemap.xml and a robots.txt?

They're complements: robots.txt tells crawlers what they may not do (which areas to stay out of), while sitemap.xml tells them what exists (which pages to look at). The robots file also typically contains the line pointing crawlers at your sitemap.

Prefer to have this handled for you?

ShiftPress moves your website off WordPress and takes care of the technical details on this page — redirects, DNS, sitemaps, speed — while you change your site simply by asking.

Get started

Keep learning

301 vs 302 redirects: what's the difference? Core Web Vitals explained: LCP, INP and CLS in plain language