In this article
What a sitemap does
An XML sitemap is a file listing the URLs of your important pages, optionally with the date each was last changed. Search engines use it to discover pages – especially pages that are new, deep inside the site or not well linked yet. It is a hint, not a command: listed pages are not guaranteed to be indexed.
Who needs one?
- New sites with few links from elsewhere.
- Large sites with hundreds or thousands of pages.
- Sites that add content often, such as shops and blogs.
- Sites with weak internal linking.
Small, well-linked sites can be found without one, but a sitemap costs nothing and gives you useful reports in Google Search Console.
What to include – and leave out
| Include | Leave out |
|---|---|
| Pages you want in search results | Pages marked noindex |
| The canonical version of each page | Duplicates, tracking-parameter URLs |
| Full, absolute URLs (https://…) | Redirecting or broken URLs |
| URLs from one domain | Pages blocked in robots.txt |
Priority and changefreq
The sitemap protocol has optional priority and changefreq fields. Google has said it ignores both. It does use lastmod when the dates are consistently accurate – so only include it if it reflects real content changes.
Limits
One sitemap can hold up to 50,000 URLs and 50 MB uncompressed. Bigger sites use several sitemaps listed in a sitemap index file.
How to create a sitemap
- Collect your page URLs, one per line – from your CMS, a crawler export or a spreadsheet.
- Paste them into the XML Sitemap Generator.
- The tool removes duplicates, skips invalid lines, escapes characters such as “&”, and warns if URLs from several domains are mixed.
- Download
sitemap.xmland upload it to your site’s root folder.
Clean your list first with Remove Duplicate Lines if it came from several sources.
Submit it to Google and Bing
- Add a line to robots.txt:
Sitemap: https://yoursite.com/sitemap.xml. - In Google Search Console, open Sitemaps, enter the sitemap address and submit.
- In Bing Webmaster Tools, submit it under Sitemaps.
Check back after a few days: Search Console reports how many URLs were discovered and any that could not be read.
Image and video sitemaps
Sites that rely on image or video search can add extra information to sitemaps, or use separate image and video sitemaps, so search engines find media that is loaded by scripts. Most small sites do not need them – normal pages with images that have descriptive file names and alt text are found without help.
WordPress and other platforms
WordPress has generated a basic sitemap at /wp-sitemap.xml since version 5.5, and SEO plugins replace it with their own. Shopify, Wix and Squarespace generate sitemaps automatically. The generator is ideal for static sites, custom-built sites and for adding extra URLs a platform misses. Make a matching robots.txt with the Robots.txt Generator.