Search engines find pages mainly by following links. On a well-linked site that works fine, but new pages, deep pages and pages with few internal links can take a long time to be discovered. An XML sitemap gives crawlers a direct list of the URLs you want them to know about.
This guide explains what goes into a sitemap, which parts search engines pay attention to, how to handle large sites, and how to create, upload and submit a sitemap when your platform does not make one for you.
What an XML sitemap is
An XML sitemap is a file, usually at https://www.example.com/sitemap.xml, that follows the protocol published at sitemaps.org. A minimal one looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/</loc>
<lastmod>2026-09-29</lastmod>
</url>
<url>
<loc>https://www.example.com/about</loc>
</url>
</urlset>
Each <url> entry has a required <loc> (the full address) and three optional tags.
The optional tags, honestly
| Tag | Meaning | How Google treats it |
|---|---|---|
<lastmod> |
When the page last changed meaningfully | Used when it is consistently accurate |
<changefreq> |
How often the page is expected to change | Ignored |
<priority> |
Relative importance from 0.0 to 1.0 | Ignored |
Google's documentation says it ignores changefreq and priority, and uses lastmod only if it proves reliable. Other search engines may treat them differently, but there is little benefit in guessing values. An accurate lastmod is the one optional tag worth effort.
Limits and sitemap indexes
A single sitemap file may contain at most 50,000 URLs and must be no larger than 50 MB uncompressed. Larger sites split their URLs across several files and list those files in a sitemap index:
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>https://www.example.com/sitemap-1.xml</loc></sitemap>
<sitemap><loc>https://www.example.com/sitemap-2.xml</loc></sitemap>
</sitemapindex>
You then submit only the index. Splitting by section (products, blog, categories) also makes it easier to see indexing problems for each part of the site.
What belongs in a sitemap
Include only URLs you want to appear in search:
- Canonical URLs only. Not
?sort=pricevariants, tracking links or duplicate versions. - Pages that return status 200. Not redirects, not 404s.
- Indexable pages. Not pages marked
noindex, and not URLs blocked in robots.txt. - One protocol and host. If your site uses
https://www., every URL should too.
A sitemap full of redirects and duplicates sends mixed signals and makes Search Console reports harder to read.
Build a sitemap with our generator
The XML Sitemap Generator turns a list of URLs into a valid file. It does not crawl your site, so you need the list first, for example from your CMS, a spreadsheet or a crawler export.
- Open the XML Sitemap Generator.
- Choose Full URLs to paste complete addresses, or Base URL + paths to paste paths such as
/aboutand have the tool add your domain. - Paste one entry per line into the text box.
- Set lastmod to Omit, Today or Pick a date. Only use a date if it reflects real changes.
- Leave changefreq and priority on Omit (Google ignores it), unless another consumer of your sitemap needs them. Priority can be Same for all or By URL depth.
- Keep Remove duplicate URLs on.
#fragmentsare always stripped. - Check the URLs and Files counters and the Checks: invalid lines are listed and skipped, duplicates are counted, and URLs spanning several hosts are flagged.
- Press Download sitemap.xml. With more than 50,000 URLs, the button becomes Download sitemaps.zip, containing numbered sitemap files plus
sitemap-index.xml.
The preview shows the first 200 URLs; downloads contain all of them.
Upload and submit it
- Upload the file to the root of your site so it is available at
https://www.example.com/sitemap.xml. - Reference it in robots.txt by adding a line such as
Sitemap: https://www.example.com/sitemap.xml. Any crawler that reads robots.txt can then find it. The Robots.txt Generator can add this line for you. - Submit it in Google Search Console under Sitemaps, and in Bing Webmaster Tools. This gives you reports on how many URLs were discovered and indexed.
A sitemap helps discovery, but it does not guarantee that every URL will be indexed. Search engines still decide based on quality and duplication.
Other ways to get a sitemap
Your CMS. WordPress (since version 5.5), Shopify, Wix, Squarespace and most modern platforms generate a sitemap automatically. If yours does, use it; it updates itself when you publish. Look for /sitemap.xml or /wp-sitemap.xml on your site.
Framework plugins. Static site generators and web frameworks usually have a sitemap plugin that builds the file during deployment.
Crawlers. Desktop SEO crawlers can crawl your site and export a sitemap. This catches pages you might forget, but also includes whatever the crawl finds, so review the list.
A generator from a pasted list is best for small static sites, one-off landing page sets, or when you need full control over exactly which URLs are included.
Troubleshooting
"Couldn't fetch" in Search Console
Check the file opens in a browser, returns status 200, is not blocked by robots.txt, and is served as XML.
URLs with ampersands break the file
In XML, & must be written as &. The generator escapes this automatically; hand-edited files often forget.
Pages submitted but not indexed
The sitemap did its job of discovery. Look at the page itself: is it thin, duplicate, or canonicalised elsewhere? Test crawl access with the Robots.txt Tester.
Multilingual sites
Sitemaps can also list language alternates with xhtml:link entries. The Hreflang Tag Generator produces that format.
Frequently asked questions
Does every website need a sitemap?
Not strictly. Small, well-linked sites are usually crawled fine without one. Sitemaps help most with large sites, new sites and pages that are hard to reach through links.
How many URLs can one sitemap contain?
Up to 50,000 URLs and 50 MB uncompressed. Larger sites use several sitemap files listed in a sitemap index.
Does Google use priority and changefreq?
No. Google has said it ignores both. It uses lastmod when the dates are consistently accurate.
Where should the sitemap file be placed?
Usually at the site root, such as /sitemap.xml. Under the sitemaps protocol, a file in a subfolder is generally expected to list only URLs within that folder, so the root is the simplest choice.
How often should I update my sitemap?
Whenever pages are added or removed. Automatic generation by your CMS or build process keeps it current without manual work.