What is an XML sitemap, and do I need one?
Short answer
An XML sitemap is a file on your website that lists the pages you want search engines to know about. A small, well-linked site can be found without one, but it costs almost nothing, most website platforms create it automatically, and it helps Google find new or poorly linked pages. It doesn't make Google index them.
An XML sitemap is a file on your website that lists the addresses of the pages you want search engines to know about. XML (Extensible Markup Language) is only the format: a plain list written so a machine can read it. Visitors never see it. It’s different from a sitemap page written for people, which is an ordinary page of links. You should almost certainly have one, with a clear idea of what it can and can’t do.
What a sitemap does and doesn’t do
Google uses the file to discover pages. The file has no say over what Google does with them afterward.
| A sitemap does | A sitemap doesn’t |
|---|---|
| Tell search engines which addresses exist on the site | Make Google index a page it has decided not to keep |
| Say when each page last changed, which Google may use if the dates are kept accurate | Improve where any page ranks |
| Give Google Search Console a list to report against, so you can see which listed pages were stored | Override an instruction elsewhere that blocks or excludes a page |
Google treats the file as a suggestion. It can crawl pages that aren’t in it and ignore pages that are.
Whether your site needs one
Strictly, a small site may not. Google’s own guidance says that a small site where every page can be reached by following links from the homepage will usually be found without a sitemap. The cases where it helps most are a new site that few other sites link to, pages that aren’t reachable from the menu, a site that adds pages often, and a very large site.
A typical home-service site meets at least one of those. It has service pages and pages for the cities it works in, and now and then it gains a page for a new service. I’d always have a sitemap on a site like that, because the cost is close to nothing. WordPress creates a basic one on its own, and most other platforms do the same. The more useful question is whether the one you have is accurate.
What belongs in it
Only pages you want in search results, each at its final address. A sitemap is a statement of which pages you consider worth indexing, and it loses its value when it contradicts the rest of the site. The common faults are:
- Addresses that redirect somewhere else, or that no longer exist.
- Pages carrying an instruction not to index them, such as a thank-you page shown after a form is sent.
- Two versions of the same page. Each entry should be the version named by the page’s canonical tag.
- A file made once by hand at launch and never updated, so the pages added since are missing.
A sitemap generated automatically by the site avoids the last problem, which is one reason I prefer it to a static file. It still needs checking, since the automatic version often includes archive and tag addresses nobody wants indexed.
How to tell Google about it
Submit the sitemap’s address in the Sitemaps report in Search Console. The report then shows whether Google could read the file and how many addresses it found. You can also name the sitemap in the site’s robots.txt file, where other search engines will find it.
The useful part comes afterward. Search Console lets you compare the pages you submitted with the pages Google stored. Any page that sits in the sitemap and outside the index is worth a look, and working through that gap is part of indexing and crawling work.
A sitemap is no substitute for linking pages together sensibly. A page that appears in the sitemap and that nothing on the site links to is still a weak page in Google’s eyes. You may also read about crawl budget, the amount of a site Google is willing to fetch in a given period. That’s a concern for very large sites, and a contractor’s site of a hundred pages doesn’t need a sitemap built around it.