What Is an XML Sitemap and Does My Website Need One?
A plain-English guide to XML sitemaps: what they do, which sites need one, what belongs in it and how to submit it to Google.
An XML sitemap is a file that lists the pages on your website you want search engines to know about. Think of it as a delivery list you hand to Google: "here are my important URLs, and here is when each one last changed." It does not force anything into the index, but it makes discovery faster and more reliable, especially for pages that are hard to reach through links.
This guide explains what a sitemap actually does, which websites benefit most, what to put in it and what to keep out, and how to check that Google is reading it.
What an XML sitemap looks like
A sitemap is a simple text file written in XML. Each page gets a url entry with its address in loc and, optionally, the date it was last meaningfully updated in lastmod. Most sites keep it at /sitemap.xml in the root of the domain.
Older guides also mention priority and changefreq. Google has said it ignores both, so you can leave them out without losing anything. The two values that matter are the URL itself and an honest lastmod date.
Does your website really need a sitemap?
Google can find most pages by following links, so a sitemap is not a ranking factor. It is a discovery aid. You will get the most value from one if your site is:
- New โ few external links point to it yet, so crawlers have fewer ways in.
- Large โ hundreds or thousands of pages, such as a shop or a news archive.
- Poorly linked internally โ some pages are only reachable through search boxes or filters.
- Updated often โ fresh
lastmoddates help search engines prioritise recrawls.
A ten-page brochure site with a clear menu can live without one, but even there it costs nothing and gives you a useful report in Search Console. For almost every site, the answer is "yes, add one."
What to include, and what to leave out
A sitemap should be a list of your best, canonical, indexable pages. Every URL in it is a small promise to Google that the page is worth crawling. Include:
- Pages that return a 200 status code.
- The canonical version of each page (one URL per piece of content).
- Pages you actually want people to find from search.
Leave out redirected URLs, pages blocked by robots.txt, pages with a noindex tag, login and cart pages, internal search results, and duplicate URLs with tracking parameters. Mixing these in sends conflicting signals and is one of the most common reasons Search Console reports "submitted URL not selected as canonical" or "submitted URL marked noindex."
Size limits and sitemap index files
One sitemap file can hold up to 50,000 URLs and must be no larger than 50 MB uncompressed. Bigger sites split their URLs across several sitemaps (for example one for products, one for blog posts) and list those files in a sitemap index. Splitting by section has a side benefit: in Search Console you can see indexing problems per section instead of one large blended number.
How to create and submit your sitemap
If your CMS already produces a sitemap, check that it follows the rules above. If it does not, or you run a hand-coded site, the free SeoSpidie XML sitemap generator builds a valid file you can upload to your root folder. Then:
- Open the sitemap URL in your browser and confirm it loads without errors.
- Add a line to robots.txt:
Sitemap: https://example.com/sitemap.xml. Our robots.txt generator can add it for you. - In Google Search Console, open Sitemaps, paste the address and submit.
- Come back after a few days and look at the "discovered pages" count and the page indexing report.
When you want a step-by-step walkthrough of the generator itself, read how to create an XML sitemap for your website for free.
Keeping the sitemap healthy
A sitemap is not a set-and-forget file. Each time you delete, merge or redirect pages, the old URLs should leave the sitemap. Only change lastmod when the content really changed; bumping every date daily teaches search engines to ignore the field. Every few months, run the URLs through a bulk indexability checker to catch pages that have quietly become redirected, blocked or noindexed.
Related guides
More free tools: browse all our free SEO tools, no sign-up needed.
Frequently asked questions
Does an XML sitemap improve rankings?
Not directly. It helps search engines find and recrawl your pages, which can lead to faster indexing. Rankings still depend on content quality, relevance and links.
How long does Google take to read a new sitemap?
Usually anywhere from a few hours to a few days. Search Console shows the last read date next to each submitted sitemap.
Should I include images in my sitemap?
You can add image entries if important images are loaded in ways crawlers might miss, such as through JavaScript. For ordinary img tags with descriptive alt text, it is rarely necessary.
Is an HTML sitemap the same thing?
No. An HTML sitemap is a normal page for visitors that links to your main sections. An XML sitemap is written for search engines. Many sites use both.