Somewhere on your website there is a page Google has not found yet. Maybe it is brand new, maybe nothing links to it, maybe it sits four clicks deep in a menu nobody uses. An XML sitemap is the cheapest insurance against that problem: a plain file that lists every page you want search engines to find, so discovery never depends on luck. This guide explains what an XML sitemap actually does, what belongs in one, how to create and submit yours, and the handful of mistakes that quietly undo the whole exercise.
What an XML sitemap actually is
An XML sitemap is a file, usually sitting at yoursite.com/sitemap.xml, that lists the URLs on your site along with a small amount of information about each one, such as when the page was last modified. It follows a shared standard, the Sitemaps protocol, which Google, Bing and every other major search engine reads the same way. The honest way to picture it is a map you hand to a crawler: here are my pages, here is where they live, no digging required. Search engines still discover your site mostly by following links, but the sitemap gives them a complete, authoritative list to check their work against. If you are new to how crawling and indexing fit together, our guide to how search engines work covers the full journey from crawl to ranking.
What it does (and does not do)
The job of an XML sitemap is discovery. It helps Google find URLs it might otherwise miss and revisit pages that change often. Google's own guidance is clear about who benefits most: large sites where internal linking cannot reach everything, new sites with few external links pointing at them, and sites with a lot of rich media or news content. If your site is small and well linked, Google says its crawlers will usually find everything anyway, and the sitemap is a safety net rather than a necessity.
Just as important is what an XML sitemap does not do. It is a hint, not a command. Listing a URL does not guarantee Google will crawl it, index it or rank it, and a sitemap on its own will not lift your rankings by a single position. It cannot fix pages blocked by robots.txt, rescue thin content, or override a noindex tag. Discovery is step one of the search pipeline; the sitemap simply makes step one reliable.
The protocol also supports specialised extensions. Image sitemaps help Google find pictures that are loaded by scripts, video sitemaps carry details like duration and description, and news sitemaps matter for publishers chasing fast indexing of time-sensitive stories. Most businesses never need any of these, but it is worth knowing the format can describe more than plain pages when your content leans heavily on media.

What belongs in the file (and what does not)
The rule is simple: your XML sitemap should list the canonical, indexable version of every page you want in Google, and nothing else. Every URL in it should return a 200 status, be free of noindex tags, and be the exact version you would choose if Google asked you to pick one.
That means leaving out redirected URLs, duplicate and parameter variations, internal search results, and utility pages like carts and logins. Every junk URL you include is a small vote against your own credibility: Google learns your sitemap is noisy and trusts it less as a signal.
Two technical limits are worth knowing. A single sitemap file can contain up to 50,000 URLs and must stay under 50MB uncompressed. Bigger sites split their URLs across multiple files and tie them together with a sitemap index. And of the optional fields, lastmod is the one Google actually uses, provided the dates are truthful; the priority and changefreq fields are ignored, so there is no point tuning them.
The one-line rule: an XML sitemap is a list of the pages you want indexed, not a list of every URL your site can generate. If a URL redirects, canonicalises elsewhere or carries a noindex tag, it has no business being in there.
How to create an XML sitemap
For most businesses this job is already done. WordPress generates a native sitemap at /wp-sitemap.xml, and SEO plugins like Yoast and Rank Math replace it with a cleaner one at /sitemap_index.xml. Shopify builds and maintains /sitemap.xml automatically for every store. Custom-built sites can generate an XML sitemap with a crawler such as Screaming Frog, or with a build script if pages change often.

Prefer generated over hand-made. A sitemap written once by hand goes stale the day you publish your next page, and stale files are worse than none, because they teach Google to distrust what you submit. Let the CMS or the build process own the file, so it updates itself every time content changes.
Wherever the file lives, reference it in your robots.txt with a single line, Sitemap: https://www.yoursite.com/sitemap.xml, so any crawler that reads robots.txt finds your XML sitemap immediately, without being told.
Submitting your sitemap in Google Search Console
Submission is a two-minute job. In Google Search Console, open Sitemaps in the left menu, paste in your sitemap URL, and press Submit. Search Console then reports how many URLs it discovered, and the Pages report shows how many actually made it into the index. That gap between discovered and indexed is one of the most useful diagnostics in SEO: a wide gap points at quality or duplication problems worth chasing down.
Google retired its old sitemap ping endpoint in 2023, so submitting through Search Console, or listing the file in robots.txt, are the supported paths now. Bing has an equivalent flow in Bing Webmaster Tools, and the same file serves both engines, which is one more argument for keeping it clean.
Resubmit whenever the structure of your site changes. A site migration that goes live without a fresh sitemap is one of the most common ways new URLs stay invisible for weeks.
Common sitemap mistakes
The same faults show up in almost every audit we run. Sitemaps still listing URLs that now redirect. Sitemaps that include noindexed pages, sending Google two contradictory signals at once. Stale files that have not updated since the site was rebuilt. Every lastmod date set to today, which teaches Google to ignore the field entirely. And sitemaps that return a 404 because a plugin changed the URL and nobody noticed for months. Faults like these persist because nothing visibly breaks on the site itself; the only symptom is new pages indexing slowly, and that tends to get blamed on everything else first.
None of these is hard to fix, and on a big site the payoff is real: a clean sitemap helps Google spend its crawl budget on the pages that earn money. If you want to check your whole technical setup in one pass, our technical SEO checklist covers sitemaps alongside everything else, in the order worth checking.
Want it handled? Our technical SEO service audits and fixes sitemaps, indexing and crawl issues as part of every campaign. Get in touch for a plain-English look at where your site stands.