Fix Sitemap Contains URLs Which Are Blocked by Robots.txt: 4 Causes
Sitemap contains URLs which are blocked by robots.txt means your two files disagree. Find the Disallow rule behind each URL, then decide which file is wrong.

TL;DR — Sitemap contains URLs which are blocked by robots.txt is a Search Console warning that means your sitemap asks Google to crawl URLs that your robots.txt forbids. The four usual causes are a prefix rule that matches more than intended, a wildcard that blocks parameter URLs you listed, a blocked file type, and a User-agent: Googlebot group that silently replaces every * rule. Fix it URL by URL: if the page should rank, change robots.txt; if it shouldn’t, take it out of the sitemap.
The warning is easy to wave off because Google still reads the sitemap. But each flagged URL is one Google was told is important and then told it can’t see. Those pages don’t get crawled, so changes to them never reach the index.
What Does Sitemap Contains URLs Which Are Blocked by Robots.txt Mean?
It means at least one URL in a submitted sitemap matches a Disallow rule that applies to Googlebot, so Google can’t crawl a page you asked it to crawl. It’s listed in Google’s Manage your sitemaps help page, which describes it as Google not being able to “access all the content listed in your sitemap” and says to “modify your robots.txt file to allow Googlebot to access it.”
That advice assumes robots.txt is the file that’s wrong. Often it isn’t. The warning only tells you the two files disagree. It doesn’t tell you which one is lying.
It is also not the same as other robots.txt states in Search Console:
| Search Console message | Where it shows | What is blocked | Google reads the sitemap? |
|---|---|---|---|
| Sitemap contains urls which are blocked by robots.txt | Sitemaps report, warning | Some URLs listed in the sitemap | Yes |
| Couldn’t fetch | Sitemaps report, status | The sitemap file itself, or the fetch failed | No |
| Blocked by robots.txt | Page indexing report | A page Google found anywhere, sitemap or link | Not relevant |
| Indexed, though blocked by robots.txt | Page indexing report | A page indexed from links alone | Not relevant |
If the status is Couldn’t fetch, robots.txt might be blocking the sitemap file, and nothing in it is being read. That’s a bigger problem, covered in Sitemap couldn’t fetch.
What Causes Blocked Sitemap URLs?
I built a small test site on a local server with a sitemap index, two child sitemaps listing 12 URLs, and a robots.txt with four realistic mistakes in it:
User-agent: *
Disallow: /search
Disallow: /*?
Disallow: /*.pdf$
Disallow: /partners/
Allow: /partners/press-kit/
User-agent: Googlebot
Disallow: /partners/
Crawl-delay: 2Each line looks reasonable on its own. Together they produce four distinct causes:
- A prefix that’s too short.
Disallow: /searchwas meant for the internal search page. Robots.txt paths are prefixes, so it also blocks/search-engine-optimization-guide/, a real article in the sitemap. - A wildcard that catches sitemap URLs.
Disallow: /*?blocks every URL with a query string. That’s fine, unless the product sitemap lists/products/trail-runner/?color=red. - A file type rule.
Disallow: /*.pdf$blocks/docs/pricing-sheet.pdf, which someone added to the sitemap on purpose. - A Googlebot group. Someone added it to set a crawl delay. Google doesn’t support
Crawl-delay, but the group itself changes which rules Googlebot reads. That’s the next section.
Why Does Adding a Googlebot Group Change Everything?
Google’s robots.txt specification says crawlers follow “the group with the most specific user agent that matches the crawler’s user agent.” Only one group applies. Rules aren’t combined across * and Googlebot.
So the moment robots.txt contains User-agent: Googlebot, Googlebot ignores everything under User-agent: *. That includes the Allow lines.
I ran a checker (the script is below) against the test site as two different crawlers. Same robots.txt, same 12 sitemap URLs:
== googlebot
✗ /partners/press-kit/
blocked by "Disallow: /partners/"
1 of 12 sitemap URLs blocked for googlebot
== bingbot
✗ /search-engine-optimization-guide/
blocked by "Disallow: /search"
✗ /docs/pricing-sheet.pdf
blocked by "Disallow: /*.pdf$"
✗ /products/trail-runner/?color=red
blocked by "Disallow: /*?"
✗ /products/road-racer/?color=blue&size=10
blocked by "Disallow: /*?"
4 of 12 sitemap URLs blocked for bingbotThe two crawlers got completely different results, and neither is what the author meant:
- For Googlebot, the press kit is blocked. The
Allow: /partners/press-kit/line lives in the*group, so Googlebot never sees it. OnlyDisallow: /partners/applies. - For Googlebot, everything else is open.
/search,/*?and/*.pdf$are also only in the*group. Googlebot can crawl internal search results and every parameter URL. The Googlebot group meant to slow Google down actually opened up most of the site to it. - For Bingbot, the
*group applies as written, so it gets the four blocks the author never noticed.
This is why the warning can look random. Search Console shows only what Googlebot sees. When you test the URL in a generic checker that reads the * group, it disagrees with Google, and the actual cause is a group three lines further down the file.
How to Fix Blocked Sitemap URLs in 6 Steps
Get the full list, not the samples. The Sitemaps report shows a few example URLs. Run the checker below against your live sitemap to list every URL that’s blocked and the rule blocking it.
Read robots.txt as Googlebot does. Look for any group whose
User-agentnames Googlebot. If one exists, it’s the only group Google uses. Check it before anything else.Group the blocked URLs by rule. Hundreds of flagged URLs usually come from two or three lines. The checker prints the rule for each URL, so sort by that.
Decide which file is wrong, per rule. Use the table in the next section. Pages that should rank need a robots.txt change. Pages that shouldn’t rank need to come out of the sitemap.
Make the change, then re-run the checker as every crawler you care about. Fixing a Googlebot group often reveals blocks that were hidden behind it, as the test below shows.
Tell Google. Google caches robots.txt for up to 24 hours. Request a recrawl from the robots.txt report under Search Console settings, then resubmit the sitemap. Use URL Inspection’s live test on one flagged URL to confirm it now reads as allowed.
Step 5 matters more than it looks. On the test site, I deleted the Googlebot group and changed nothing else. The Googlebot count went from 1 to 4:
== step 2: Googlebot group deleted
✗ /search-engine-optimization-guide/ blocked by "Disallow: /search"
✗ /docs/pricing-sheet.pdf blocked by "Disallow: /*.pdf$"
✗ /products/trail-runner/?color=red blocked by "Disallow: /*?"
✗ /products/road-racer/?color=blue&size=10 blocked by "Disallow: /*?"
4 of 12 sitemap URLs blocked for googlebotThe press kit came back, because the longer Allow: /partners/press-kit/ now applies to Googlebot too. Three problems that the Googlebot group had hidden were now visible. Removing the group was the right fix. It just wasn’t the last one.
The final fix used both files:
User-agent: *
Disallow: /search$
Disallow: /*?
Disallow: /partners/
Allow: /partners/press-kit/
Sitemap: https://example.com/sitemap.xml/searchbecame/search$, so it only matches the search page. Search result URLs like/search?q=shoesare still blocked by/*?.- The PDF rule went, because the pricing sheet is meant to be found.
- The two parameter URLs came out of the product sitemap. They are color variants of pages that are already listed, and their canonical is the clean URL.
Result: 0 of 10 sitemap URLs blocked, for Googlebot and Bingbot alike.
Which File Is Wrong: the Sitemap or robots.txt?
Ask one question for each blocked URL: should this page appear in Google’s results?
| Blocked URL type | Should it rank? | Which file to change | Fix |
|---|---|---|---|
Article caught by a short prefix (/search blocking /search-engine-...) | Yes | robots.txt | Tighten the rule with $ or a trailing / |
Page rescued by an Allow in the * group | Yes | robots.txt | Copy the Allow into the Googlebot group, or delete that group |
Parameter, sort, or filter variant (?color=red) | No | Sitemap | List only the canonical URL |
| Internal search results page | No | Sitemap | Remove it; keep the block |
| Staging, admin, cart, or account page | No | Sitemap | Fix the sitemap generator’s filter |
| PDF or file you want found | Yes | robots.txt | Narrow or drop the file type rule |
| Page you want out of Google | No | Sitemap, then add noindex | Unblock it so Google can see the noindex |
The last row is a common mistake. Robots.txt stops crawling, not indexing. A page that is blocked and linked from elsewhere can still be indexed, which is how you end up with Indexed, though blocked by robots.txt. To remove a page, allow crawling and serve a noindex instead.
Most of these conflicts get fixed on the sitemap side. A sitemap should list only canonical URLs that return 200. If your generator includes everything in the database, it’ll keep producing this warning no matter how often you edit robots.txt. Fix the generator’s filter once. The same goes for stale entries, covered in fixing sitemap lastmod dates.
A Script That Checks Every Sitemap URL Against robots.txt
This is the checker that produced the output above. It needs Node 18+ and no dependencies. It reads robots.txt, picks the group a given crawler would use (merging groups with the same name), follows one level of sitemap index, and applies Google’s precedence rules: the longest matching path wins, and on a tie Allow wins.
// check-sitemap-robots.mjs — node check-sitemap-robots.mjs <origin> [sitemap-path] [agent]
const [origin, smPath = '/sitemap.xml', agent = 'googlebot'] = process.argv.slice(2);
// 1. Parse robots.txt into groups. Consecutive user-agent lines share one group.
const robots = await fetch(new URL('/robots.txt', origin)).then((r) => (r.ok ? r.text() : ''));
const groups = [];
let cur = null;
for (const raw of robots.split(/\r?\n/)) {
const m = raw.replace(/#.*/, '').match(/^s*([a-z-]+)s*:s*(.*?)s*$/i);
if (!m) continue;
const key = m[1].toLowerCase(), val = m[2];
if (key === 'user-agent') {
if (!cur || cur.rules.length) groups.push((cur = { agents: [], rules: [] }));
cur.agents.push(val.toLowerCase());
} else if (cur && (key === 'allow' || key === 'disallow') && val) {
cur.rules.push({ allow: key === 'allow', path: val });
}
}
// 2. Pick the most specific matching group (merging same-name groups), else '*'.
const named = groups.filter((g) => g.agents.includes(agent));
const rules = (named.length ? named : groups.filter((g) => g.agents.includes('*'))).flatMap((g) => g.rules);
// 3. Longest matching rule wins; on a tie, allow wins. * = any chars, $ = end.
const toRe = (p) => new RegExp('^' + p.replace(/[.+?^${}()|[]\]/g, '\$&').replace(/*/g, '.*').replace(/\$$/, '$'));
function verdict(pathAndQuery) {
let best = null;
for (const r of rules) {
if (!toRe(r.path).test(pathAndQuery)) continue;
if (!best || r.path.length > best.path.length || (r.path.length === best.path.length && r.allow)) best = r;
}
return best;
}
// 4. Walk the sitemap (one level of sitemap index) and report blocked URLs.
async function locs(url) {
const xml = await fetch(url).then((r) => r.text());
const found = [...xml.matchAll(/<loc>s*([^<s]+)s*</loc>/g)].map((m) => m[1].replace(/&/g, '&'));
return /<sitemapindex/.test(xml) ? (await Promise.all(found.map(locs))).flat() : found;
}
const urls = await locs(new URL(smPath, origin));
let blocked = 0;
for (const u of urls) {
const { pathname, search } = new URL(u);
const rule = verdict(pathname + search);
if (rule && !rule.allow) {
blocked++;
console.log(`✗ ${pathname + search}\n blocked by "Disallow: ${rule.path}"`);
}
}
console.log(`${blocked} of ${urls.length} sitemap URLs blocked for ${agent}`);Run it once per crawler you care about: node check-sitemap-robots.mjs https://example.com for Googlebot, then add /sitemap.xml bingbot for Bing. It matches user-agent names exactly and skips Google’s handling of percent-encoding and byte order marks, so treat it as a fast first pass. For edge cases, URL Inspection’s live test is the final word. The blocked by robots.txt post compares open-source parsers against Google’s own.
When Is It Safe to Ignore the Warning?
Rarely, but a few cases don’t need urgent work:
- A handful of URLs you were about to drop anyway. Remove them from the sitemap on the next deploy and move on.
- A third-party sitemap you don’t control, such as one a plugin submits. Remove that sitemap from Search Console if it duplicates your main one.
Don’t ignore it when the blocked URLs are pages you want ranking, or when the count keeps growing. A growing count means the sitemap generator is listing something it shouldn’t, and every new page of that type will add another row. If you also manage AI crawler groups in the same file, syncing robots.txt AI bot blocks shows how to add named groups without changing what Googlebot reads. If Search Console rejects the sitemap file itself as a web page, see fixing Sitemap is HTML. More fixes from this Search Console series are in the AI search hub.
FAQ
What does sitemap contains URLs which are blocked by robots.txt mean?
It is a warning in Search Console’s Sitemaps report. At least one URL listed in your sitemap matches a Disallow rule in robots.txt, so Google cannot crawl a page you asked it to crawl. Google’s help page says to find the blocked URL with the URL Inspection tool and change robots.txt to allow Googlebot to access it, but sometimes the sitemap is the file that is wrong.
Does this warning stop Google from reading the rest of my sitemap?
No. It is a warning, not a fetch error, so Google still reads the sitemap and crawls the URLs that are allowed. Only the blocked URLs are skipped. The exception is when robots.txt blocks the sitemap file itself, which shows up as Couldn’t fetch and stops Google reading every URL in it.
Why does Googlebot ignore my User-agent: * rules?
Because Google follows only the most specific group that matches its name. If robots.txt has a User-agent: Googlebot group, Googlebot ignores the User-agent: * group completely, including its Allow lines. Copy every rule you still want into the Googlebot group, or delete the Googlebot group if it only held directives Google doesn’t support, such as Crawl-delay.
Should I remove blocked URLs from the sitemap or unblock them in robots.txt?
Decide per URL. If the page should rank, unblock it in robots.txt. If it is a parameter variant, a search result, or any page you never wanted indexed, remove it from the sitemap and keep the block. A sitemap should list only canonical URLs that return 200, so most of these conflicts are fixed on the sitemap side.
How long does the warning take to clear after a fix?
Google generally caches robots.txt for up to 24 hours, so a robots.txt fix is not seen immediately. You can ask for a recrawl from the robots.txt report in Search Console settings, then resubmit the sitemap. The warning updates the next time Google processes the sitemap.
Sources
- Google Search Console Help, Manage your sitemaps using the Sitemaps report: the “Sitemap contains urls which are blocked by robots.txt” warning and Google’s suggested fix.
- Google Search Central, How Google interprets the robots.txt specification: most-specific group selection, longest-match precedence, the least-restrictive tie-break,
*and$wildcards, the 500 KiB limit, and the 24-hour cache. - Google Search Console Help, robots.txt report: the report that replaced the robots.txt Tester in November 2023, including the recrawl request.
- First-party test: a local site with a sitemap index, two child sitemaps listing 12 URLs, and the robots.txt shown above, checked with the script in this post as Googlebot and Bingbot, December 2, 2026.
Frequently asked questions
Google Search · Preferred sources
Prefer this site on Google
If you already read this writing, add umesh-malik.com as a Preferred Source. Google can then highlight it with a preferred badge in Top Stories, AI Overviews, and AI Mode — for you, not as a site-wide ranking boost.
Related Articles

Web Engineering
Fix Sitemap URL Not Allowed in Search Console: 11 Cases Tested
Sitemap URL not allowed means a <loc> sits outside the sitemap's host, protocol, port or folder. I ran 11 setups through a checker: 6 fail, 1 needs robots.txt.

Web Engineering
Fix Your Sitemap Appears to Be an HTML Page: 8 Causes Tested
Your sitemap appears to be an HTML page means Google got HTML, not XML. I tested 8 causes. Two hit only Googlebot, so it looks fine in your browser.

Web Engineering
Fix Host Had Problems Last Week: 8 robots.txt Failures Tested
Host had problems last week means Googlebot hit 429s, 5xx, timeouts or DNS errors. I tested 8 robots.txt faults: the 403 that passes is the scary one.
Keep reading
Get new posts on AI, Claude Code & LLMs
New deep-dives on AI engineering, Claude Code, and developer tooling — follow along however you prefer.
About the Author
Software engineer writing about AI, Claude Code, LLMs, OpenAI, Anthropic, and developer tooling. 5+ years building production systems at Expedia Group, Tekion, and BYJU'S.