How to create a sitemap: what to include, how to generate an XML sitemap with your CMS or a free generator, Google's limits, and how to submit it in Search Console.

On this page
In short
a sitemap is a file that lists the URLs you want search engines to find, usually in XML. Most CMSs generate one automatically (WordPress, Shopify, Wix, Webflow); otherwise, use a generator or build it from your list of pages. Include only canonical, indexable pages that return 200, keep each file under 50,000 URLs or 50 MB, then submit it in Google Search Console and reference it in robots.txt. A sitemap helps discovery; it does not guarantee indexing.
Want to go further? Ask
Quick quiz
Who should fix the technical side of your site?
Our advice for you
Check whether your CMS already makes one is the right solution for you
Number 1 in this ranking, the best match for your answers.
Our advice for you
Otherwise, generate it is the right solution for you
Number 2 in this ranking, the best match for your answers.
Our advice for you
Include the right URLs is the right solution for you
Number 3 in this ranking, the best match for your answers.
Our advice for you
Respect the limits is the right solution for you
Number 4 in this ranking, the best match for your answers.
Knowing how to create a sitemap is basic SEO hygiene, especially for new sites, large sites and sites with pages that few internal links reach. This guide follows Google's documentation on building and submitting a sitemap: formats, limits, what to include, how to generate the file and how to check it. For the definition, see our glossary entry on the XML sitemap.
A sitemap tells search engines which pages exist on your site and, optionally, when they last changed. The XML format follows the open sitemaps.org protocol, supported by Google, Bing and others. Google also accepts RSS or Atom feeds and plain text files with one URL per line.
| Format | Best for | Notes |
|---|---|---|
| XML | Most sites | Supports lastmod, images, videos, news, hreflang |
| RSS / Atom | Blogs and frequently updated content | Often generated by the CMS already |
| Text (.txt) | Very simple sites | One URL per line, nothing else |
| Sitemap index | Large sites | Lists several sitemap files |
Google says sitemaps are most useful for large sites, new sites with few external links, sites with many pages not well linked internally, and sites with rich media or news. A small, well-linked site can be crawled without one, but a sitemap costs little and helps you monitor indexing in Search Console. Most SEOs create one for every site.
WordPress (core since version 5.5, or through SEO plugins), Shopify, Wix, Squarespace and Webflow generate sitemaps automatically, usually at /sitemap.xml. Open that address on your domain first.
Use a crawler or the free XML sitemap generator, or build the file from your database or framework. Static site generators and frameworks often have a sitemap plugin.
Each file can contain up to 50,000 URLs or 50 MB uncompressed, in UTF-8. Above that, split into several files and list them in a sitemap index.
Google uses lastmod only when it is consistently accurate, and ignores priority and changefreq. Update lastmod for significant content changes, not for a new copyright year.
Tip
Split large sites into one sitemap per section (products, categories, articles). In Search Console, you then see indexing coverage section by section and spot where pages are left out.
Sitemap: https://www.example.com/sitemap.xml to your robots.txt so all engines find it (the robots.txt generator can add it).Watch out
A sitemap full of URLs that redirect, return errors or carry noindex sends mixed signals and makes the Search Console reports useless. Regenerate it after redesigns and migrations, and validate it with the free sitemap checker.
| Error in Search Console | Usual cause | Fix |
|---|---|---|
| Couldn't fetch | Wrong URL, blocked by robots.txt, server error | Open the URL in a browser, check robots.txt and server |
| Invalid format or XML errors | Unescaped characters, wrong namespace | Validate the XML, escape & as & |
| URLs not indexed | Low-value, duplicate or noindex pages | Clean the list, improve the pages |
| Too many URLs | Over 50,000 entries | Split and use a sitemap index |
AI crawlers such as GPTBot and ClaudeBot also read robots.txt, where your sitemap line helps them discover pages. Decide which bots you allow (see robots.txt and AI crawlers); the free llms.txt generator covers the optional file some AI tools read.
Create a sitemap with only your indexable, canonical pages, keep it under Google's limits, submit it and watch the reports. It is a small step that makes indexing problems visible. Sorank, SEO and GEO software that runs on autopilot, publishes articles that your CMS adds to its sitemap automatically, with internal links that help discovery; see the Sorank plans, with a 3-day free trial. For indexing in general, read Google indexing.
Most CMSs publish it at /sitemap.xml or /sitemap_index.xml on your domain. You can also find it in your robots.txt (a line starting with Sitemap:) or in the Sitemaps report of Google Search Console if someone already submitted it.
No. A sitemap helps Google discover URLs, but Google decides what to crawl and index based on quality, duplication and technical access. Use the Page indexing report to see which listed pages are excluded and why.
It should update automatically whenever you publish, change or delete pages; most CMSs do this. If you generate it manually, regenerate it after each batch of changes and keep lastmod accurate.
THEY TRIED SORANK BEFORE YOU
