AIO Copilot

What is an XML sitemap?

An XML sitemap is a file that lists the URLs on a site you want search engines to find, with optional details such as when each page last changed. It helps discovery but does not guarantee crawling or indexing.

Search engines mostly find pages by following links. A sitemap is a second route in: a file, usually at /sitemap.xml, that lists your URLs directly. Google's sitemaps overview describes it as a file where you provide information about the pages, videos and other files on your site and the relationships between them. Google accepts sitemaps in XML, RSS, mRSS or Atom, and plain text, with no preference among them. XML can carry a last-modified date for each URL, which a plain list of URLs cannot.

A sitemap tells Google which URLs you want in search, not which ones it must crawl. The overview says plainly that using one doesn't guarantee that all the items in it will be crawled and indexed. Our technical SEO audit checklist covers how to compare a sitemap with what Google has actually indexed.

Do you need a sitemap?

Large sites, new sites and media-heavy sites benefit most. Google's overview says you may need one if the site is large, if it is new with few external links, or if it has a lot of rich media or news content. You may not need one if the site is small, which Google defines as about 500 pages or fewer, if Googlebot can reach every important page by following links from the homepage, and if there are few media files or news pages that need to appear in search. Google's guide to building a sitemap adds that platforms such as WordPress, Wix and Blogger have likely made one available already, so for most small sites the job is checking the sitemap rather than writing it.

What are the sitemap size limits?

A single sitemap can hold 50,000 URLs or 50 MB uncompressed, whichever comes first. Larger sites split their URLs across several sitemaps and list them in a sitemap index file, then submit the index; an index cannot list other index files. The file must be UTF-8 encoded and use fully qualified, absolute URLs. List only the URLs you want shown in search: where the same content is reachable at several addresses, Google's build guide says to choose the preferred one and list only that. Sitemap inclusion is a weak canonical signal, according to Google's guide on consolidating duplicate URLs, so a file full of redirects and duplicates works against you.

Does Google use lastmod, priority and changefreq?

Google uses lastmod when it is accurate and ignores the other two. The build guide says Google ignores priority and changefreq values and uses lastmod only if it is consistently and verifiably accurate. Google's 2023 post on sitemaps explains what that means: the date of the last significant change, such as edits to the main text or to structured data, not a tweak to a sidebar or footer. A generator that stamps every URL with the current date on each build gives Google a reason to stop trusting your dates. The same post deprecated Google's sitemap ping endpoint and said requests to it would return a 404 error once it was retired six months later.

How do you submit a sitemap?

Submit it in Search Console's Sitemaps report, or add a line such as "Sitemap: https://www.example.com/sitemap.xml" anywhere in your robots.txt file, which Google picks up the next time it crawls that file. Google's build guide calls submitting a sitemap merely a hint: it does not guarantee that Google will download it or use it for crawling. Once submitted, the Sitemaps report shows whether Google could fetch the file, when it last read it and how many page URLs it discovered, with the caveat that a discovered URL has not necessarily been crawled or indexed. Before submitting, paste the file into the free sitemap validator to check its namespace, loc and lastmod values, duplicate URLs and the 50,000 URL limit.