XML Sitemap Validator
Validate your XML sitemap for errors, check URL structure, and ensure proper formatting for optimal SEO crawling. Our free sitemap checker helps you identify and fix sitemap issues before they impact your search rankings.
Validate XML Sitemap
Enter your sitemap URL to check for errors, validate XML structure, and analyze URL entries
Enter your sitemap URL with or without https://
What This Tool Checks
Our sitemap validator performs comprehensive analysis of your XML sitemap:
Common Sitemap Locations
Check your robots.txt file for the Sitemap: directive to find your sitemap location.
No Results Yet
Enter a sitemap URL and click "Validate Sitemap" to check for errors
Your sitemap validation results will appear here
How to Use This Sitemap Validator Tool
Using our XML sitemap validator is quick and straightforward. Follow these steps to check your sitemap for errors:
Enter Your Sitemap URL
Type or paste the full URL to your XML sitemap (e.g., example.com/sitemap.xml). You can enter it with or without "https://" - we'll automatically add it if needed.
Click "Validate Sitemap"
Our sitemap checker will fetch your sitemap, parse the XML, and validate every element against the official sitemap protocol specifications.
Review the Results
See the complete validation report including URL count, file size, any errors or warnings, and a preview of your sitemap entries. Export results as CSV for further analysis.
For multiple sitemaps, switch to the "Multiple Sitemaps" tab and enter up to 5 sitemap URLs (one per line). This is useful for validating all your sitemaps at once, especially if you use a sitemap index.
Why XML Sitemaps Matter for SEO
XML sitemaps are essential for helping search engines discover and index your website's pages. While search engines can find pages through links, a sitemap provides a direct roadmap to all your important content.
Discovery of new and updated pages by search engines
Maximum URLs per sitemap file (protocol limit)
Search engines know when content was last modified
Key Benefits of XML Sitemaps:
- Improved Crawl Efficiency: Search engines don't have to crawl through your entire site to find pages. The sitemap points them directly to important content.
- Faster Indexing of New Content: When you publish new pages, search engines can discover them through your sitemap rather than waiting for internal links.
- Priority Signals: Use the priority and changefreq tags to hint which pages are most important and how often they change.
- Large Site Management: For sites with thousands of pages, sitemaps ensure all content is discoverable regardless of link depth.
- Orphaned Page Recovery: Pages with few or no internal links can still be found through the sitemap.
Use our sitemap tester regularly to ensure your sitemap is error-free and properly formatted for search engines.
XML Sitemap Structure Explained
A valid XML sitemap follows a specific structure defined by the sitemap protocol. Here's a breakdown of each element:
Basic Sitemap Structure
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/page1</loc>
<lastmod>2024-01-15</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
</urlset><urlset>The root element that encapsulates the entire sitemap. Must include the xmlns namespace attribute pointing to the sitemap protocol.
<url>Container for each URL entry. A sitemap can contain up to 50,000 URL elements.
<loc>The full URL of the page. Must be absolute (include protocol and domain). URLs must be properly escaped (use & for ampersands).
<lastmod>The date the page was last modified. Use W3C datetime format: YYYY-MM-DD or full datetime with timezone (YYYY-MM-DDThh:mm:ss+00:00).
<changefreq>How frequently the page is likely to change. Valid values: always, hourly, daily, weekly, monthly, yearly, never. This is a hint, not a command.
<priority>The relative importance of this URL compared to other URLs on your site. Values range from 0.0 to 1.0 (default is 0.5). Only affects crawl priority within your own site.
Sitemap Index Files
When your site has more than 50,000 URLs or your sitemap exceeds 50MB, you need to split it into multiple sitemaps and use a sitemap index to reference them.
Sitemap Index Structure
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-posts.xml</loc>
<lastmod>2024-01-15</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-pages.xml</loc>
<lastmod>2024-01-10</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-products.xml</loc>
<lastmod>2024-01-14</lastmod>
</sitemap>
</sitemapindex>When to Use Sitemap Index:
Large Websites (50,000+ URLs)
Split URLs across multiple sitemaps and reference them from an index file.
Content Type Organization
Separate sitemaps for posts, pages, products, images, and videos makes management easier.
Incremental Updates
Update only the specific sitemap that changed rather than regenerating one massive file.
Multi-language Sites
Maintain separate sitemaps for each language or region for cleaner organization.
Tip: A sitemap index can reference up to 50,000 sitemaps, giving you a theoretical maximum of 2.5 billion URLs (50,000 sitemaps x 50,000 URLs each).
Best Practices for XML Sitemaps
Follow these best practices to ensure your sitemap is optimized for search engine crawling:
Include Only Canonical URLs
Only add the canonical version of each page to your sitemap. Don't include duplicate URLs, paginated pages (except page 1), or URLs that redirect to other pages.
Keep URLs Consistent with Site
URLs in your sitemap should match exactly how they appear on your site. Be consistent with trailing slashes, www vs non-www, and HTTP vs HTTPS.
Update Lastmod Accurately
Only update the lastmod date when the page content actually changes significantly. Don't update it for minor template changes or automatically on every publish.
Submit to Search Engines
Submit your sitemap URL in Google Search Console, Bing Webmaster Tools, and other search engine tools. Also add it to your robots.txt file with the Sitemap: directive.
Use UTF-8 Encoding
Always save your sitemap with UTF-8 encoding and declare it in the XML header. Properly escape special characters (& becomes &, etc.).
Keep File Size Under Limits
Each sitemap file should be under 50MB uncompressed and contain no more than 50,000 URLs. Use gzip compression for larger files.
Validate Regularly
Run your sitemap through a validator like this tool after any significant changes or at least monthly. Fix any errors immediately.
Only Include Indexable Pages
Don't include pages with noindex meta tags, pages blocked by robots.txt, or pages that return 4xx/5xx status codes.
Automate Sitemap Generation
Use your CMS or a sitemap plugin to automatically generate and update your sitemap. Manual maintenance becomes error-prone on large sites.
Common Sitemap Errors and How to Fix Them
Here are the most common XML sitemap errors that can prevent search engines from properly crawling your site:
Invalid XML Syntax
Malformed XML prevents search engines from parsing your sitemap entirely.
Fix: Validate your XML syntax, check for unclosed tags, ensure proper escaping of special characters, and verify UTF-8 encoding.
Missing or Incorrect Namespace
The xmlns attribute must point to the correct sitemap protocol URL.
Fix: Ensure your urlset tag includes: xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
Invalid Lastmod Date Format
Dates must follow W3C datetime format (YYYY-MM-DD or full ISO 8601).
Fix: Use formats like "2024-01-15" or "2024-01-15T10:30:00+00:00". Don't use formats like "January 15, 2024" or "01/15/2024".
URLs Not Matching Site
Sitemap URLs differ from actual page URLs (protocol, www, trailing slashes).
Fix: Ensure sitemap URLs exactly match how pages are accessed on your site. If your site uses https://www.example.com/, don't use https://example.com/ in the sitemap.
Including Non-200 Status URLs
Sitemap contains URLs that return 404, 301, or other non-200 status codes.
Fix: Remove URLs that don't return 200 OK status. Audit your sitemap against actual page availability regularly.
Exceeding Size Limits
Sitemap has more than 50,000 URLs or exceeds 50MB in size.
Fix: Split your sitemap into multiple files and use a sitemap index. Consider gzip compression to reduce file size.
Duplicate URLs
The same URL appears multiple times in the sitemap.
Fix: Remove duplicate entries. Implement de-duplication in your sitemap generation process.
Wrong Content-Type Header
Server sends sitemap with text/html instead of application/xml content type.
Fix: Configure your server to send sitemaps with Content-Type: application/xml or text/xml header.
Frequently Asked Questions About XML Sitemaps
What is an XML sitemap?▼
An XML sitemap is a file that lists all the important URLs on your website in a structured XML format. It helps search engines like Google, Bing, and others discover, crawl, and index your pages more efficiently. The sitemap protocol was developed by Google and is now supported by all major search engines.
Do I need an XML sitemap for my website?▼
Yes, almost every website benefits from having an XML sitemap. While small sites with good internal linking may not strictly need one, sitemaps are especially important for: large websites with many pages, new sites with few external links, sites with pages that aren't well linked internally, sites with rich media content (images, videos), and news websites that need rapid indexing.
How many URLs can be in a sitemap?▼
A single XML sitemap can contain a maximum of 50,000 URLs and must not exceed 50MB uncompressed. If your site has more URLs, you need to split them across multiple sitemaps and use a sitemap index file to reference them. The sitemap index can reference up to 50,000 individual sitemaps.
Where should I put my sitemap file?▼
Your sitemap should be placed in your site's root directory (e.g., https://example.com/sitemap.xml). While you can place it elsewhere, the sitemap can only include URLs from its directory level and below. Add a Sitemap: https://example.com/sitemap.xml directive to your robots.txt file and submit the URL to Google Search Console.
What's the difference between a sitemap and sitemap index?▼
A regular sitemap contains a list of URLs on your website with optional metadata (lastmod, priority, changefreq). A sitemap index is a "sitemap of sitemaps" - it contains references to multiple individual sitemaps rather than URLs. Use a sitemap index when you have multiple sitemaps, typically for large sites or for organizing sitemaps by content type.
Does the priority tag actually affect Google rankings?▼
No, the priority tag does not directly affect rankings. Google has stated that they largely ignore the priority and changefreq hints in sitemaps. These values only help signal relative importance of pages within your own site for crawl scheduling. Focus instead on accurate lastmod dates and ensuring all important pages are included.
How often should I update my sitemap?▼
Your sitemap should update automatically whenever you add, remove, or significantly modify content. Most CMS platforms and sitemap plugins handle this automatically. The lastmod date for individual URLs should only change when the actual content changes - don't update it artificially. Search engines may lose trust in lastmod dates that change without corresponding content changes.
Should I include noindex pages in my sitemap?▼
No, you should not include pages with noindex tags in your sitemap. Only include pages that you want search engines to index. Similarly, don't include pages blocked by robots.txt, pages that redirect (301/302), or pages that return error status codes (4xx/5xx). Your sitemap should be a clean list of indexable, canonical URLs.
Can I use gzip compression for my sitemap?▼
Yes, you can and should use gzip compression for large sitemaps. Save your sitemap with a .xml.gz extension (e.g., sitemap.xml.gz). The uncompressed size limit is 50MB, but compression can significantly reduce bandwidth. Search engines will automatically decompress the file. Make sure your server sends the correct Content-Encoding: gzip header.
What date format should I use for lastmod?▼
Use W3C datetime format. The simplest valid format is YYYY-MM-DD (e.g., "2024-01-15"). For more precision, use full ISO 8601 format: YYYY-MM-DDThh:mm:ss+00:00 (e.g., "2024-01-15T14:30:00+00:00"). Always include the timezone offset for full datetime formats. Avoid formats like "January 15, 2024" or "01/15/2024".
How do I add my sitemap to Google Search Console?▼
To submit your sitemap to Google: 1) Log into Google Search Console, 2) Select your property, 3) Go to "Sitemaps" in the left menu under "Indexing", 4) Enter your sitemap URL and click "Submit". Google will then regularly check your sitemap for updates. You can monitor the status and any errors found in the same section.
Why does my sitemap show fewer indexed pages than submitted?▼
This is normal and expected. Google doesn't index every URL it finds - it evaluates each page's quality and relevance. Common reasons for non-indexing include: duplicate content, thin content, pages blocked by noindex, canonicalization to different URLs, crawl budget limitations, or Google determining the content isn't valuable enough to index. Check Google Search Console's "Pages" report for specific reasons.
Tool Limitations
This sitemap validator performs structural and format validation. However, there are some limitations you should be aware of:
Does Not Check URL Accessibility
This tool validates the sitemap file itself but does not verify whether each URL in the sitemap actually returns a 200 OK status or is accessible. Use a broken link checker for that.
Does Not Verify Canonical Consistency
We don't check if sitemap URLs match the canonical tags on those pages. Mismatches between sitemap and canonical can cause indexing issues.
Does Not Validate Robots.txt Consistency
We don't check if URLs in the sitemap are blocked by robots.txt. Including blocked URLs in a sitemap is a common mistake.
Large Sitemaps Truncated
For performance reasons, we display only the first 100 URLs from large sitemaps. The full URL count is still shown, and validation covers all URLs.
What This Tool DOES Validate
XML syntax and structure, proper namespace declaration, URL format validation, lastmod date format, changefreq and priority values, file size limits, duplicate URL detection, and sitemap index structure.
Tip: For comprehensive sitemap validation, also submit your sitemap to Google Search Console, which will report additional issues like unreachable URLs and indexing problems over time.