Validate now: Use our XML Sitemap Validator to check any sitemap for errors, missing fields, and SEO issues — free, no signup required.
What Is an XML Sitemap?
An XML sitemap is a machine-readable file that lists the important URLs on your website. It follows the sitemaps.org protocol and tells search engines (and AI crawlers) which pages exist, when they were last modified, and how important they are relative to each other.
Think of it as a table of contents for your website. Without one, search engines rely solely on crawling links — which means orphaned pages (those with no internal links) may never be discovered. For sites with 50+ pages, a sitemap is essential.
XML Sitemap Structure & Required Fields
A valid XML sitemap must follow this structure:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/page</loc>
<lastmod>2026-03-15</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
</urlset><loc>The full URL of the page. Must be absolute (start with https://).
<lastmod>Last modification date in W3C datetime format (YYYY-MM-DD). Google uses this to prioritize crawling.
<changefreq>How often the page changes: always, hourly, daily, weekly, monthly, yearly, never. Mostly ignored by Google in 2026.
<priority>Relative importance (0.0 to 1.0). Only meaningful within your own site. Default is 0.5.
Common XML Sitemap Errors
Missing XML namespace
Add xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" to the <urlset> tag. Without this, search engines may not parse the file.
Relative URLs in <loc>
All URLs must be absolute (https://example.com/page, not /page). Relative URLs cause parsing failures.
Invalid lastmod format
Use W3C datetime: YYYY-MM-DD or YYYY-MM-DDThh:mm:ss+00:00. Common mistake: using MM/DD/YYYY format.
URLs returning 404 or 301
Remove dead URLs and redirects from your sitemap. Only include canonical, 200-status URLs.
Sitemap too large
Max 50,000 URLs or 50MB per file. Split into multiple sitemaps and use a sitemap index file.
Including noindex pages
Don't include pages with noindex meta tags. This sends conflicting signals to search engines.
Wrong encoding
Use UTF-8 encoding. Declare it in the XML header: <?xml version="1.0" encoding="UTF-8"?>
Sitemap Index Files
For large websites, use a sitemap index that points to individual sitemaps:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-pages.xml</loc>
<lastmod>2026-03-15</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-blog.xml</loc>
<lastmod>2026-03-14</lastmod>
</sitemap>
</sitemapindex>Sitemaps and AI Crawlers
AI crawlers like GPTBot, ClaudeBot, and PerplexityBot use sitemaps to discover content — just like traditional search engines. A well-maintained sitemap increases your chances of being cited in AI-generated answers (GEO). Key tips:
- ✓Include your most comprehensive, authoritative pages
- ✓Keep
<lastmod>accurate — AI crawlers prioritize fresh content - ✓Reference your sitemap in robots.txt:
Sitemap: https://example.com/sitemap.xml - ✓Use Foglift's Robots.txt Tester to verify AI crawlers can access your sitemap
Frequently Asked Questions
Do I need an XML sitemap?
If your site has more than 50 pages, is new, or has orphan pages (not linked internally), yes. Google's own docs say sitemaps are 'helpful for most sites.' For SEO and GEO, it's a best practice to always have one.
Where should my sitemap be located?
Convention is /sitemap.xml at your domain root (e.g., https://example.com/sitemap.xml). You should also reference it in your robots.txt file with a Sitemap: directive. Submit it to Google Search Console and Bing Webmaster Tools for faster discovery.
How often should I update my sitemap?
Update whenever content changes — adding new pages, removing old ones, or significantly modifying existing content. If your CMS auto-generates sitemaps (WordPress, Next.js, etc.), this happens automatically. Just verify the output is valid.
Can a sitemap hurt my SEO?
A broken or misconfigured sitemap can hurt — listing 404 pages, noindex pages, or sending conflicting signals wastes crawl budget and confuses search engines. That's why validation is important. Use our free validator to catch issues before they affect your rankings.
Related Tools & Guides
Robots.txt Tester
Analyze your robots.txt and check AI crawler access
Robots.txt for AI Crawlers
How to configure robots.txt for ChatGPT, Claude, and Perplexity
Technical SEO Audit Guide
Complete checklist for technical SEO, including sitemaps
Website Audit Checklist
Complete website audit checklist for SEO and performance
Check your entire website's SEO health
Our full website scan checks sitemap, robots.txt, meta tags, performance, security, and more — free.
Scan Your Website FreeValidate Your Sitemap