Choose a way to do this check
XML sitemap tester on this site
- Paste the XML and optionally supply its published sitemap address.
- Check duplicate locations, lastmod dates and directory scope. An index does not validate its child files.
Screaming Frog List mode
- Load sitemap URLs and export status, indexability and canonical.
- Investigate URLs that redirect, return errors or nominate a different canonical before resubmitting.
Search Console Sitemaps report
- Submit the public file in the matching property and review whether Google could read it.
- Use URL Inspection for representative pages. A successful submission is not an indexing verdict.

1. Decide which pages belong in the file
Include absolute URLs for public pages that you want indexed. Use the preferred scheme, hostname and path. Exclude staging pages, redirects, error URLs, intentional noindex pages and duplicate variants that point to another canonical. A sitemap helps make discovery and preferred URL signals consistent. The search engine still decides what it will index.
On a large site, export the URLs from your CMS or routing data so pages enter the sitemap as they are published and leave when they are retired. Check what happens to drafts, archived products and pages that are temporarily unavailable. Apply those rules consistently rather than repairing the same bad entries by hand.
2. Generate valid XML
Place the file at the site root unless you deliberately manage a different scope. Use UTF-8, the sitemap namespace and one loc element per URL. XML-escape ampersands in values. Include lastmod only where you can supply a reliable date for a significant change to the page. Do not update every date whenever the sitemap file is generated.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/guides/</loc>
<lastmod>2026-11-20</lastmod>
</url>
<url>
<loc>https://www.example.com/contact/</loc>
</url>
</urlset>Use a sitemap index when the file would exceed 50,000 URLs or 50 MB uncompressed. Split it on useful publishing boundaries, such as category and product pages, if distinct files would make failures easier to identify.
3. Check the live file and test real URLs
Run this check from a scratch folder. It confirms the response can be downloaded and the file is well-formed XML. It does not validate the sitemap protocol or check the pages inside it.
curl -fsS https://www.example.com/sitemap.xml -o sitemap.xml
xmllint --noout sitemap.xmlCheck the root element and namespace against the protocol. Test for duplicate loc values, entries on the wrong hostname and values that are not absolute URLs. Crawl a representative sample from each template and check status, robots access, canonical and noindex. A successful XML parse tells you nothing about these checks.
4. Publish and monitor the right file
Add a Sitemap reference to robots.txt and submit the file in the appropriate webmaster property where useful. Check whether the engine could read it. Compare changes in the report with the actual generator output before changing your publishing rules.
Sitemap: https://www.example.com/sitemap.xmlIf a release adds many unwanted URLs, restore the previous generator or file and verify the output again. Fix the publishing condition so the same entries cannot slip back in on the next regeneration.
Technical references
Frequently asked questions
Do URLs have to be in the sitemap to be discovered?
No. Internal links also support discovery. Use both deliberately.
Can a valid sitemap contain pages that are not indexed?
Yes. Discovery, crawling, indexing and URL selection are separate decisions.
What if the file contains redirects?
Replace them with the preferred final addresses if those should be listed.
Should lastmod change daily?
Only update it when it reflects a significant change to the page.
Written by Richie Aubin
Published
