How to Fix "Blocked by Robots.txt" Warnings in Search Console
'Blocked by robots.txt' means your /robots.txt file contains a Disallow rule matching that URL, preventing Googlebot from crawling the content or CSS/JS assets. Remove overly broad Disallow wildcards or replace them with meta noindex if you want de-indexing.
Why Does This Issue Occur? (Symptom & Cause Matrix)
| Observed Symptom | Root Technical Cause | Recommended Fix |
|---|---|---|
| Public page matches Disallow rule | Overbroad prefix (e.g., Disallow: /blog) | Narrow Disallow strictly to /api/, /admin/, /checkout/ |
| 'Indexed, though blocked' warning | External links point to a robots-blocked URL | Unblock in robots.txt and add noindex if you want it dropped |
Step-by-Step Fix Checklist
- 1
Test the URL Against robots.txt
Check every Disallow line in https://yourdomain.com/robots.txt for prefix or wildcard conflicts.
- 2
Never Block CSS, JS, or Public Tools
Googlebot needs JS/CSS access to render pages properly for Core Web Vitals and mobile usability.
- 3
Use Noindex Instead of Robots.txt for De-Indexing
If a page is already indexed and should be hidden, allow crawling briefly so Google sees <meta name="robots" content="noindex">.
Clean White-Hat robots.txt Directives
User-agent: *
Allow: /
Disallow: /api/
Disallow: /admin/
Disallow: /checkout/
Sitemap: https://yourdomain.com/sitemap.xmlPeople Also Ask About This Error
Why can a page still appear on Google if blocked by robots.txt?
Robots.txt blocks crawling, not indexing. If other sites link to the URL, Google can index the URL without seeing its content.
Does Disallow: /_next/ hurt Next.js SEO?
Yes! Never disallow /_next/static/ assets because Googlebot requires those scripts and stylesheets to render your pages.