An XML sitemap is supposed to be a direct roadmap of your best pages for search engines. Too often, though, automated plugins turn sitemap.xml into a dumping ground—stuffing it with redirected URLs, parameter duplicates, 404 pages, and staging drafts marked noindex.
When your sitemap is full of broken or contradictory URLs, search engines stop trusting it as a crawl signal, and your Google Search Console account fills up with coverage warnings. Here is how to build a clean XML sitemap that search engines actually respect, which XML tags still matter today, and how to fix the errors that stall indexing.
Which Pages Actually Belong in Your XML Sitemap?
Before generating a sitemap file, apply one strict filter: only include URLs that return an HTTP 200 OK status code, are allowed to be crawled, and are the canonical version you want shown in search results.
If a URL fails any of those three tests, leave it out of your sitemap:
| URL Type | Include in Sitemap? | Why |
|---|---|---|
Public pages, blog posts, product pages, and core landing pages (200 OK) |
Yes | These are your indexable master pages that deserve crawl priority. |
Pages with a noindex meta tag or HTTP header (login, cart, thank-you pages, admin screens) |
No | Listing a noindex URL in a sitemap sends conflicting instructions ("index this" vs. "do not index this") and triggers Search Console errors. |
Duplicate URLs with tracking parameters (?utm_source=) or sort filters (?sort=price) |
No | Only list the clean master address. See our guide on how to use canonical tags to stop duplicate content. |
Redirected URLs (301 or 302) and broken URLs (404 or 410) |
No | Replace redirected URLs with the final destination URL, and delete dead links immediately. |
Paths disallowed in your robots.txt file |
No | Asking crawlers to index a URL that your robots.txt forbids them from visiting triggers a coverage warning. |
Anatomy of a Valid XML Sitemap (And the Tags Google Actually Ignores)
A standard XML sitemap uses the namespace defined by the sitemaps.org protocol. Each page lives inside a <url> block with up to four child tags:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/</loc>
<lastmod>2026-10-15</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://example.com/blog/technical-seo-audit</loc>
<lastmod>2026-10-12</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
While all four tags are valid under the XML specification, search engines do not treat them equally. According to Google's official Build and Submit a Sitemap documentation:
<loc>(Required): The full, absolute canonical URL of the page (includinghttps://). This is the most important field in the file.<lastmod>(Highly useful if honest): The date the page content was last meaningfully updated, written in W3C Datetime / ISO 8601 format (YYYY-MM-DD). Google actively uses<lastmod>to schedule recrawls—provided your dates are accurate. If your CMS resets<lastmod>to today's date on every page whenever the sitemap regenerates, Google detects the fake timestamps and ignores them.<changefreq>and<priority>(Ignored by Google): Many older SEO guides spend paragraphs telling you to set your homepage priority to1.0and category pages to0.8. Do not sweat those numbers—Google officially ignores both<priority>and<changefreq>because site owners routinely marked every page on their site as high priority and updated daily. Including them in your generated file is completely harmless and remains valid under the standard protocol, but they will not force Googlebot to crawl a page faster.
Hard Protocol Limits: Size, URL Counts, and Entity Escaping
When a sitemap fails to parse entirely in Search Console, it usually comes down to one of two technical rules in the sitemaps.org specification:
1. The 50,000 URL and 50 MB Ceiling
A single XML sitemap file can hold a maximum of 50,000 URLs and must not exceed 50 MB (52,428,800 bytes) uncompressed. If your site grows past 50,000 URLs—or if you simply want to keep your blog posts, products, and landing pages organized in separate files—split them into smaller sitemaps (such as sitemap-posts.xml and sitemap-products.xml) and list those files inside a parent sitemap_index.xml file.
2. Unescaped Ampersands (&) Breaking XML Parsing
Because a sitemap is strict XML, raw special characters inside a URL will crash the XML parser at the exact line where they appear. The most common culprit is an unescaped ampersand (&) inside a URL query string:
<!-- Breaks XML parsing: raw & character -->
<loc>https://example.com/catalog?category=books&format=hardcover</loc>
<!-- Valid XML: & is escaped as & -->
<loc>https://example.com/catalog?category=books&format=hardcover</loc>
Standard sitemap generators automatically escape ampersands (&), single quotes ('), double quotes ("), and angle brackets (< and >) for you, which is one reason you should avoid concatenating XML strings by hand.
How to Fix the 3 Most Common Search Console Sitemap Errors
After submitting your sitemap in Google Search Console, check the Pages and Sitemaps reports. If you spot any of these three warnings, here is how to resolve them:
1. "Submitted URL marked 'noindex'"
This happens when a URL is listed inside your sitemap.xml, but the page itself has a <meta name="robots" content="noindex"> tag or an X-Robots-Tag: noindex HTTP header. Often, a CMS plugin automatically includes author archives, tag pages, or internal thank-you pages in the sitemap even though those pages are set to noindex.
The fix: Decide whether the page should rank in Google. If it should, remove the noindex tag from the page. If it should stay out of search results, remove the URL from your XML sitemap.
2. "Submitted URL blocked by robots.txt"
Your sitemap is inviting Googlebot to index a URL, but a Disallow rule in your robots.txt file is blocking Googlebot from fetching it. Follow the rules in our guide on how to configure a robots.txt file to either unblock the path (if the page is public and meant to rank) or delete the blocked URL from your sitemap.
3. "Sitemap could not be read" or "Couldn't fetch"
Before blaming Google Search Console's famous "Couldn't fetch" message on a Google bug, open your sitemap URL in an incognito browser tab and check three things:
- Does the server return an HTTP
200 OKwith aContent-Type: application/xmlortext/xmlheader? - Is a security firewall or CDN returning an HTML challenge page to automated bots?
- Is there a blank line or whitespace before the opening
<?xml version="1.0" encoding="UTF-8"?>declaration? (In strict XML, even a single space or newline before<?xmlinvalidates the document.)
Generating and Submitting Your XML Sitemap
For static websites, custom PHP or Node.js projects, or clean curated sitemaps where you want full control over every URL included, you can build a compliant file right in your browser using the XML Sitemap Generator:
- Paste your canonical URLs: Enter the full
https://addresses of your indexable pages—making sure they match the exact format set in the Canonical URL Generator. - Set your
lastmoddate and optional attributes: Choose the last modification date and optional frequency or priority settings. - Generate and download: Click generate to create the UTF-8 XML structure locally in your browser, download it as
sitemap.xml, and upload it to your website's root directory (https://yourdomain.com/sitemap.xml). - Declare it in
robots.txtand Search Console: AddSitemap: https://yourdomain.com/sitemap.xmlto the bottom of yourrobots.txtfile (which you can build with the Robots.txt Generator), then submit the sitemap URL under the Sitemaps tab in Google Search Console and Bing Webmaster Tools.
Frequently Asked Questions (FAQ)
Does every website really need an XML sitemap?
If your site has fewer than 50 pages and every single page is linked cleanly from your navigation menu, crawlers will find your content even without a sitemap. However, submitting an XML sitemap is still worth the two minutes it takes because it unlocks segmented indexing reports in Google Search Console and gives crawlers accurate <lastmod> update timestamps.
Can I compress my XML sitemap with Gzip?
Yes. Search engines natively accept Gzip-compressed sitemaps (such as sitemap.xml.gz). Compressing a large sitemap reduces bandwidth by 70% to 80%, though the uncompressed XML inside the archive must still stay under the 50 MB and 50,000-URL limit.
Should I include translated pages in my XML sitemap?
Yes. Every indexable language or regional version of a page belongs in your sitemap. Just make sure those localized URLs are properly connected using reciprocal language tags, as explained in our guide on how to use hreflang tags.