Playbook
seo
easy
Fix robots.txt blocking your sitemap
Your robots.txt is blocking Googlebot from crawling pages listed in your sitemap. Here is how to spot and fix the conflict.
10 minutesLast reviewed 2026-06-09
What is happening
You have URLs listed in sitemap.xml that robots.txt tells search engines not to crawl. Google Search Console reports these as "Indexed, though blocked by robots.txt" or "Discovered — currently not indexed".
Fix it
Disallow: line.Disallow line. If it should not be indexed, remove the URL from the sitemap and add a <meta name="robots" content="noindex"> to the page itself — robots.txt alone is not enough to deindex.Example of a clean robots.txt
User-agent: *
Disallow: /admin/
Disallow: /cart/
Disallow: /search?
Sitemap: https://yourdomain.com/sitemap.xmlCommon gotchas
Disallow: /api blocks /api, /api-docs, /api/anything. Use Disallow: /api/ to scope it.Sitemap: directive must be on its own line; multiple is fine.User-agent: Googlebot block overrides the User-agent: * block for Google only.What this doesn't do
This is for the directive-conflict case. For pages that load but return weird content to Googlebot, see user-agent cloaking pitfalls.