Cyber SEO: 50% off
Preferences

Privacy is important to us, so you have the option of disabling certain types of storage that may not be necessary for the basic functioning of the website. Blocking categories may impact your experience on the website. More information (Cookie Policy)

Accept all cookies

How to Create a Sitemap: A Step-by-Step XML Sitemap Guide

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.

Published on
28/10/2026
Updated on
28/10/2026
Reading time
4 min
Cover of the guide to creating an XML sitemap, with an example sitemap file

Tools

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?

Question 1 of 425%
What is happening today?

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.

What is a 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.

FormatBest forNotes
XMLMost sitesSupports lastmod, images, videos, news, hreflang
RSS / AtomBlogs and frequently updated contentOften generated by the CMS already
Text (.txt)Very simple sitesOne URL per line, nothing else
Sitemap indexLarge sitesLists several sitemap files

Do you need a sitemap?

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.

How to create a sitemap step by step

1. Check whether your CMS already makes one

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.

2. Otherwise, generate it

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.

3. Include the right URLs

  • Only canonical URLs, in full absolute form (https://www.example.com/page).
  • Only pages that return 200 and are indexable (no noindex, not blocked in robots.txt).
  • No redirects (list the final URL, see 301 vs 302 redirects), no duplicates, no parameter variants.
  • The language versions if you use hreflang.

4. Respect the limits

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.

5. Use lastmod honestly

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.

How to submit a sitemap to Google

  1. Open Search Console, then the Sitemaps report.
  2. Enter the sitemap URL and submit.
  3. Add a line Sitemap: https://www.example.com/sitemap.xml to your robots.txt so all engines find it (the robots.txt generator can add it).
  4. Submit it to Bing Webmaster Tools too (see how to submit a website to search engines).
  5. Come back after a few days: check the status, discovered URLs and the Page indexing report.

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.

Common sitemap errors and fixes

Error in Search ConsoleUsual causeFix
Couldn't fetchWrong URL, blocked by robots.txt, server errorOpen the URL in a browser, check robots.txt and server
Invalid format or XML errorsUnescaped characters, wrong namespaceValidate the XML, escape & as &
URLs not indexedLow-value, duplicate or noindex pagesClean the list, improve the pages
Too many URLsOver 50,000 entriesSplit and use a sitemap index

Sitemaps and AI crawlers

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.

The bottom line

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.

Frequently asked questions

Where is my website's sitemap?

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.

Does a sitemap guarantee that Google indexes my pages?

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.

How often should I update my sitemap?

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.

Free SEO & GEO audit

Get your content plan for 30 days for free

We analyse your competitors, your website and your AI visibility to create a tailored content plan for free.

Our free SEO tools

See all our free tools

Get a free audit of your site

THEY TRIED SORANK BEFORE YOU

Testimonials from ambitious founders

Organic growthE-commerce

0 to 10000 visitors in 5 months

Celio Fabianomonrobotlavevitre.fr
Organic growthSoftware

0 to 5000 clients in 8 months

Thibault BMsorank.com
Organic growthLeisure and aviation

0 to 1104 clicks in 4 months

Dominiqueflight-sensations-idf.com
Organic growthLead generation for installers

x98 clicks in 2 months

LeadBolt Agencyleadbolt.online
Organic growthMusic software

x55 clicks in 5 months

Valentin Cordiertiger-sounds.com