How to add and declare an XML sitemap
A sitemap lists the URLs you want indexed and when they changed. Declare it in robots.txt so every crawler finds it.
Step by step, with screenshots: How to create a sitemap: by CMS, by generator or by hand →
Check your own site
Runs these 6 checks and the other 187, free, in about 45 seconds.
Or run only this check with the free Sitemap checker, the free XML sitemap generator or the free robots.txt tester.
What it is
An XML sitemap is a file, usually at /sitemap.xml, that lists the URLs you want search engines to index, with an optional date each one last changed. It follows the sitemaps.org protocol, and crawlers find it through a Sitemap: line in robots.txt or a submission in Google Search Console.
Search engines still discover most pages through links, but a sitemap gets new and deep pages found sooner and tells Google which URLs you consider canonical. One file holds at most 50,000 URLs or 50 MB uncompressed; larger sites split it with a sitemap index. Google ignores the priority and changefreq fields and uses lastmod only when it is accurate.
OK looks like this: the sitemap answers 200, parses as valid XML, lists only final URLs that answer 200, includes the page you test and is declared in robots.txt. getReport checks each of those and samples the listed URLs.
What a passing site looks like
- No page in your sitemap is marked noindexwarning · −2 ptseffort S
- XML sitemap is reachablewarning · −1.5 ptseffort M
- Sitemap URL status: passeswarning · −1.5 ptseffort M
- The XML sitemap follows the sitemaps.org protocolwarning · −1.5 ptseffort M
- robots.txt declares a sitemapwarning · −1 ptseffort S
- This page is listed in the sitemapinfo onlyeffort S
1. Noindex pages in the sitemap
Why it matters. The sitemap asks Google to index a page and the page asks it not to. Google follows the noindex, but the mixed signal wastes crawls and hides pages you may have meant to show.
- If the page should be found, remove the noindex from the robots meta tag or the X-Robots-Tag header.
- If it should stay hidden, remove it from the sitemap; SEO plugins drop noindex pages from their sitemap automatically once the setting is saved.
2. No working XML sitemap found
Why it matters. A sitemap lists every page you want indexed and when it changed. Without one, crawlers must find pages by following links, and deep or new pages can wait weeks.
- Generate an XML sitemap and publish it at /sitemap.xml (most CMSs and SEO plugins do this automatically).
- Make sure it returns HTTP 200 and lists at least one URL; then declare it in robots.txt and submit it in Google Search Console.
3. Sitemap URL status
Why it matters. A sitemap should list only pages that answer 200. Redirects, 404s and noindex pages in it waste crawl budget and make Google trust the file less.
- Remove deleted pages from the sitemap and list the final URL of redirected pages.
- Most CMS plugins do this automatically; if you generate the file yourself, rebuild it from the live URL list before publishing.
4. Sitemap format
Why it matters. Google reads a sitemap only when it is well-formed XML with absolute URLs and valid dates. One bad file means new pages are found late or not at all, and Search Console reports "couldn't fetch".
- Regenerate the sitemap from your CMS or SEO plugin instead of editing it by hand, and validate it after every change.
- Use absolute https URLs in <loc>, dates as YYYY-MM-DD in <lastmod>, and split files above 50,000 URLs into a sitemap index.
5. robots.txt does not declare a sitemap
Why it matters. A "Sitemap:" line in robots.txt is how crawlers find your XML sitemap without you registering it anywhere. Without it, new pages are discovered later.
- Add a line to robots.txt: Sitemap: https://your-site.com/sitemap.xml (use the full URL).
6. This page is not listed in the sitemap
Why it matters. Pages missing from the sitemap still get crawled through links, but Google finds updates to them more slowly and cannot use the lastmod hint.
- Add the page to the sitemap, or check why the generator skips it (draft status, noindex, excluded post type).
Questions people ask
What is a sitemap XML?
A sitemap XML is a file that lists the pages of a site for search engines in a fixed format: a <urlset> with one <url> entry per page, each holding a <loc> with the full URL and optionally a <lastmod> date. Search engines read it to discover pages and to notice when they change.
What does an XML sitemap look like?
A minimal sitemap starts with an XML declaration, then a <urlset> element with the sitemaps.org namespace, and one <url> entry per page containing <loc>https://example.com/shoes/</loc> and optionally <lastmod>2026-09-01</lastmod>. Use absolute https URLs, W3C dates (YYYY-MM-DD) and UTF-8 encoding. Your CMS or SEO plugin usually builds this file for you.
How many URLs can an XML sitemap contain?
Up to 50,000 URLs and 50 MB uncompressed per file, under the sitemaps.org protocol. Larger sites split their URLs over several sitemaps and list those in a sitemap index file, which can itself list up to 50,000 sitemaps. Splitting by type, such as products, categories and posts, also shows you in Search Console which section is not getting indexed.
Does every website need an XML sitemap?
Not strictly; a small site with good internal links gets crawled without one. It still helps every site: new pages get found faster, Google learns which URLs you consider canonical, and Search Console can report indexing per sitemap. Since most CMSs create one automatically, there is little reason not to have it.