- Date
Validate a Sitemap: XML Checks and Fixes
Andrii Romasiun
Sitemap validation requires checking three separate layers of your website’s configuration. The file needs well-formed XML syntax to be readable by machines. The URLs listed inside it should reflect the preferred, canonical versions of your pages. Finally, search engines need an uninterrupted network path to fetch and parse the document.
For teams moving from Google Analytics, Swetrix bridges simple, privacy-compliant, cookieless tracking with advanced product analytics, so they can keep essential growth data such as conversion funnels and session replays while gaining technical SEO insights through Search Console.
A syntax error, a relative URL, or an aggressive robots.txt rule can prevent search crawlers from reading the sitemap or reaching some listed URLs, so catching these issues early can reduce discovery delays. You can validate a sitemap by checking the file structure with a dedicated tool, correcting formatting errors, and then using Google Search Console to check whether Google can access and process the data.
Quick answer: How to validate a sitemap
Confirming that your sitemap functions correctly relies on two separate tools. Follow these steps to check the file and its accessibility.
- Locate your site’s sitemap URL.
- Use an XML sitemap generator to create and test the sitemap for syntax errors, as Google’s guidance recommends.
- Review the reported errors and correct the sitemap.
- Run the corrected sitemap through the syntax test again.
- If you have owner permissions for the property, open Google Search Console, navigate to the Sitemaps report, and submit the URL to check the latest fetch and processing status. Without owner permissions, list the sitemap in your
robots.txtfile instead.
This workflow separates structural testing from network access. A third-party validator checks the document against protocol rules, while Search Console reports whether Google could fetch and read it.

What a sitemap validator checks
Proving a sitemap is valid means checking the document against the official protocol, which specifies everything from character encoding to file size. When you submit a URL to a testing tool, the software examines the file structure, the values attached to each URL entry, and the document’s overall dimensions.
XML structure and protocol limits
A standard sitemap uses Extensible Markup Language to present machine-readable data. Search engines require a specific format. A minimal, valid example looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/blog/post/</loc>
</url>
</urlset>
The file must be UTF-8 encoded, as specified in Google’s sitemap requirements. Its XML declaration can state that encoding, and the root element must be a urlset that references the official Sitemaps protocol namespace. Inside that root, every page gets a url block containing a loc tag for its address.
Google’s XML sitemap guidance requires tag values to be entity-escaped, so ampersands in URL values must be escaped before they appear in the XML.
The protocol limits each sitemap to 50,000 URLs and 50 MB uncompressed. If your sitemap exceeds either limit, split the URLs across multiple files and submit them individually or through a sitemap index.
URL entries and sitemap metadata
Each loc tag must contain an absolute URL. Google recommends a fully qualified address that includes the protocol and domain, so a relative path like /blog/post/ does not meet that requirement.
The entries should also point to the preferred canonical versions of your pages. If a page is available with and without a www prefix, choose the preferred URL and list that version. Google recommends listing the preferred canonical URL rather than every duplicate address for the same content, so the sitemap contains the chosen address rather than duplicates.
Optional metadata tags can accompany the loc tag, and validators can check their formatting. The lastmod value should use the W3C Datetime format, which permits a date-only value in YYYY-MM-DD form, and it should give the date the linked page was last modified.
Other optional tags include priority and changefreq. A priority value must fall within the protocol’s 0.0-to-1.0 range, but Google ignores both tags. As a result, these values do not affect how often Google crawls your site or how its pages rank.
What a valid file does not prove
A successful validation pass confirms that the document meets the checks performed by the tool. However, it cannot confirm that Googlebot has permission to access the server. A firewall, a restrictive robots.txt directive, or a password prompt can block search engines from downloading an otherwise well-formed file.
Moreover, passing an XML check does not guarantee that Google will crawl or index the listed URLs. Google describes sitemap submission as a hint, and the Sitemaps report notes that a successful read does not guarantee the URLs will be crawled or indexed.

How to validate an XML sitemap with Swetrix
Swetrix provides a free Sitemap Validator that checks public XML files against the official protocol specifications.
To start the process, copy the sitemap URL generated by your system. This address usually lives at the root of your domain, such as https://example.com/sitemap.xml, though some plugins append complex strings or place the file in a subdirectory.
Open the Swetrix Sitemap Validator and paste the complete address into the input field. The tool fetches the document and parses the XML. Its published checks include character encoding, required tags, URL formatting, duplicate detection, date formats, priority values, change-frequency values, and size limits.
If the document breaks a rule, the validator returns specific errors and warnings. You might see a flag for duplicate URLs, unescaped ampersands, or a size warning if the file exceeds a limit. Because the tool identifies the nature of the formatting failure, you can return to your CMS or SEO plugin and adjust the configuration.
Once you update the settings, generate a fresh sitemap and submit the URL to the validator again. A clean report confirms that the document passes the tool’s checks.
The validator checks the sitemap document and its entries, but it does not replace a live HTTP status check for every listed page or a Googlebot access test. A clean report confirms the structural checks, not that Google can reach the file or crawl every listed URL.
Confirming Google can fetch and process the file
After validating the structure, confirm that Google can retrieve and parse the sitemap. For sitemaps submitted through the report or the Search Console API, the Sitemaps report shows Google’s latest fetch status and any processing errors.
If you have owner permissions for the property, log in to Google Search Console, open the report, and submit the validated URL so Google can attempt to download and parse it. Without owner permissions, list the sitemap in your robots.txt file instead. The report’s status definitions say that “Success” means Google fetched and read the sitemap without errors, and the listed URLs are queued for crawling.
Google describes sitemap submission as a hint, and says it does not guarantee that Google will download the sitemap or use it to crawl the listed URLs.
If the Sitemaps report shows a failure, or you want to test access before resubmitting the file, use the Live URL Inspection tool in Search Console. Paste your sitemap URL into the inspection bar and run a live test. Google’s fetch troubleshooting steps recommend checking the “Page fetch” and “Crawl allowed?” fields. “Successful” and “Yes” indicate that Google can retrieve the file and that its robots.txt rules do not block access.
Sites that also target Bing can perform a similar process. The Bing Webmaster Tools Sitemaps report provides its own processing status and details regarding reported fetch errors.
Once search engines process your sitemap and begin sending traffic to your pages, tracking that performance becomes the next priority. Swetrix offers a Google Search Console integration that pulls search queries, clicks, impressions, average click-through rates, and average positions directly into your privacy-focused analytics dashboard. Viewing this search data alongside your website analytics helps connect search visibility to on-site user behavior without relying on third-party cookies. That combination helps teams use Swetrix to follow the path from search visibility to on-site actions, with conversion funnels and session replays adding product analytics context to technical SEO insights.

Common sitemap validation errors and fixes
Even with an automated CMS, configuration issues can generate invalid files or block search engine access. When a validator or Search Console flags an issue, matching the error to its underlying cause speeds up the resolution.
| Error or concern | Practical guidance |
|---|---|
| “Couldn’t fetch” | For a sitemap submitted through Search Console, use the Sitemaps report to see when Googlebot accessed it and any potential processing errors, because submission does not guarantee that Google will download it. |
| Parsing or malformed XML error | For a standard XML sitemap, use UTF-8 encoding and the urlset root with the Sitemaps namespace. Ensure that tag values are entity-escaped. |
| Relative URLs | Use fully qualified absolute URLs that include the protocol and domain, because Google attempts to crawl URLs exactly as listed. |
| Cross-site sitemap submissions | For a sitemap that includes URLs from multiple sites, verify ownership of each site in Search Console before submitting it. |
Invalid or misleading lastmod | Set <lastmod> to the linked page’s last-modified date. Google uses the value when it is consistently and verifiably accurate. |
| Too many URLs or an oversized file | A sitemap cannot exceed 50,000 URLs or 50 MB uncompressed. If it exceeds either limit, split it into multiple sitemaps and submit them separately or through a sitemap index. |
| Valid sitemap, but crawling is not guaranteed | Submitting a sitemap is a hint, and Google does not guarantee that it will download the file or use it to crawl the listed URLs. If you submit through Search Console, the Sitemaps report can show when Googlebot accessed the sitemap and potential processing errors. |
Most of these errors require adjustments within your website infrastructure. A property mismatch can follow an SSL certificate installation or domain migration if the CMS continues generating old HTTP paths, so updating the base site URL in your software settings can fix the generated output.
Malformed XML can point to a plugin or custom database script that fails to escape special characters before writing them to the file. If you use custom scripts, run the output through an XML-aware parser or escape reserved characters such as & and < with XML entity references.
Sitemap validation FAQs
Website owners frequently misunderstand how sitemaps interact with search engines. While passing a syntax check and submitting the file can help Google discover your URLs, sitemap validation is only one component of a broader technical SEO strategy.
Indexing guarantees for valid sitemaps
A syntax check confirms that the file passed the checks performed by the validator. Submitting a sitemap gives Google a list of URLs you want it to consider, but Google describes submission as a hint and does not guarantee that it will download the sitemap or use it to crawl the listed URLs.
Automated CMS sitemaps and small websites
If your CMS automatically creates and updates a sitemap, submit its URL to Search Console once. Google can recrawl the file on its own schedule, so publishing a new post does not require another submission. For a small site, clear internal links give crawlers another way to discover pages, while the Sitemaps report lets you monitor Google’s fetch attempts.
The priority and changefreq tags
Google ignores the `` and `` tags, so these values do not change its crawl schedule or ranking decisions.
Troubleshooting "Couldn't fetch" errors
A “Couldn’t fetch” error indicates that Google could not retrieve the sitemap file. First, check the submitted URL for typos or missing path components that could lead to a 404 error. Next, open the URL to confirm that the file exists, check that robots.txt does not block Google, and use URL Inspection to test whether Googlebot can fetch it. If a fetch fails, Google will retry for a few days before stopping if the sitemap remains unavailable or has critical errors, as described in its Sitemaps report guidance.
Monitoring your website’s technical health and traffic does not require invasive tracking or complicated dashboards. Swetrix provides a privacy-focused, cookieless alternative to Google Analytics, with product analytics, server-side performance monitoring, and technical SEO tools. For teams moving from Google Analytics, Swetrix also brings advanced product analytics into that cookieless setup, including conversion funnels, session replays, and Search Console data for technical SEO insights. Validate your files with the Sitemap Validator, integrate your Search Console data, and view your user flow clearly. Start tracking ethically by setting up your Swetrix account today.