An XML sitemap is, put as simply as possible, a map of your website written in a language search engines understand. It lists every URL you want Google to know about, along with some extra information (when each one was last updated, how often it changes, what priority it has relative to the others). It isn't meant for people to read: it's meant to help Google's crawler do its job better and faster.
The question that usually follows is an obvious one: if Google already crawls the web by following links, why does it need a map on top of that? The short answer is that link-based crawling works reasonably well on small, well-interlinked sites, but becomes unreliable as soon as a site grows, has orphan pages (with no internal links pointing to them), or publishes new content frequently, like a blog or a store with a constantly changing catalogue.
What happens if you don't have one
Without a sitemap, Google can still index your site, but it depends entirely on finding each page through links, whether from other pages of yours or from external sites. If you publish a new article and don't link it well from the menu, the homepage or other content, it can take weeks to show up in the index, if it ever does. An up-to-date sitemap doesn't guarantee Google will index everything (that's always decided by the search engine itself based on each page's quality and relevance), but it does guarantee Google knows that page exists.
What a good sitemap should include
Only the URLs you actually want to rank: indexable pages, with unique content and no errors. A common mistake is including pages with a noindex tag, redirects, or duplicate URLs created by filter parameters: that wastes the crawl budget Google allocates to your site and can create confusion about which version of a page you actually want to rank. A well-kept sitemap updates automatically whenever you publish or remove content, not once a year by hand.
How you tell Google about it
Once the file is generated (usually at the root of the domain, like yourdomain.com/sitemap.xml), you declare it in Google Search Console, under the sitemaps section, and it's also referenced from the robots.txt file so any crawler can find it without you having to point it out manually. From Search Console you can also see how many URLs from the sitemap have actually been indexed and which haven't, which is a direct way to spot crawling issues before they turn into lost traffic.
What if my website is very small?
Even if you only have ten pages and all of them are well interlinked, having a sitemap costs nothing and still helps: it speeds up the discovery of changes, and it's good practice you won't need to revisit unless you change platform or URL structure.
Frequently asked questions
Does a sitemap directly improve my Google ranking?
No. A sitemap helps Google find and index your pages, but ranking depends on content quality, user experience and domain authority, among other factors. It's a precondition for ranking, not a guarantee of it.
Do I have to build the sitemap by hand?
On most content management systems (WordPress, PrestaShop, Shopify) it's generated automatically via a plugin or natively, and updates on its own whenever you publish new content. Only on custom-built sites without that automation does it need to be generated and maintained manually or via a script.
Can I have more than one sitemap?
Yes, and on large sites it's common: a sitemap index grouping separate sitemaps by content type (pages, blog, products, images), which makes it easier to spot exactly which section has an indexing problem.