Skip to content
Get a free mockup
Menu

"Blocked by robots.txt" in Search Console: what it means and how to fix it

Haider Ali· · 4 min read

"Blocked by robots.txt" means Google was not allowed to crawl a URL; "Indexed, though blocked by robots.txt" means it listed the URL anyway. Whether to fix either depends on one question: do you want that page in Google? The steps for each answer.

Two statuses in Google Search Console's Pages report involve robots.txt, and they sound like opposites:

  • "Blocked by robots.txt": your robots.txt file stopped Google from crawling the page.
  • "Indexed, though blocked by robots.txt": Google indexed the page anyway, even though robots.txt blocks it.

Those are Google's definitions, from its Page indexing report help. Whether you should do anything depends on one question.

First: do you want this page in Google?

StatusYou want it in GoogleYou want it out
Blocked by robots.txtRemove the rule that blocks itUsually fine as is. To be certain, remove the block and add noindex
Indexed, though blockedRemove the rule so Google can crawl it properlyRemove the block, add noindex, wait for it to drop

The reason for the odd-looking advice in the right-hand column: robots.txt controls crawling, not indexing. Google says robots.txt "is not a mechanism for keeping a web page out of Google" (robots.txt introduction), and that a disallowed URL can still be found and indexed when other pages link to it. A noindex tag does keep a page out, but only if Google can crawl the page and see it: if the page is blocked, the crawler never sees the noindex (noindex documentation).

Find the rule that is blocking the page

  1. In Search Console, open URL Inspection and paste the URL. It confirms "Blocked by robots.txt".
  2. Open Settings, robots.txt report. It shows the robots.txt files Google fetched for your site and when. (Google's old robots.txt Tester has been replaced by this report.)
  3. Read the file at yourdomain/robots.txt and find the rule that matches the URL's path.

Three of Google's matching rules explain most surprises (how Google reads robots.txt):

  • Only one group applies to each crawler: the one whose user-agent line matches it most specifically. If your file has a User-agent: Googlebot group, Googlebot ignores everything under User-agent: *, including the Allow lines you meant for it.
  • The longest matching path wins, so Allow: /shop/sale/ beats Disallow: /shop/ for pages under /shop/sale/.
  • On a tie, the least restrictive rule wins.
# This blocks Googlebot from the whole site, even though "*" allows it:
User-agent: *
Allow: /

User-agent: Googlebot
Disallow: /

Fix it

If you want the page indexed

  1. Edit robots.txt and remove or narrow the Disallow rule. In WordPress, robots.txt is usually generated by WordPress or your SEO plugin: Yoast has a file editor under Tools, and Rank Math under General Settings.
  2. In URL Inspection, run Test live URL. It should no longer say blocked.
  3. Click Request indexing, then Validate fix on the issue in the Pages report.

If you want the page out of Google

  1. Add <meta name="robots" content="noindex"> to the page, or send an X-Robots-Tag: noindex header.
  2. Remove the robots.txt rule for that page, so Google can see the noindex.
  3. Wait for Google to recrawl and drop it. Leave the noindex in place; do not put the robots.txt block back.

For anything private, such as a staging site or customer files, use a password instead. Google's own advice for keeping a page out is noindex or a password.

Common causes on small-business sites

  • A leftover Disallow: / from when the site was built. In our check of 348 small-business sites, 4 blocked Googlebot from their own homepage and 3 blocked every crawler.
  • Blocked theme or plugin folders. Blocking /wp-admin/ is normal. Blocking /wp-content/ or /wp-includes/ stops Google loading your CSS and JavaScript, and Google does not render JavaScript from blocked files.
  • Intentional blocks on cart, checkout, account and internal search pages. Those statuses are fine; leave them.
  • Rules your CDN adds. Cloudflare can add rules in front of your own file. They target AI training crawlers, not Googlebot, but read the served file to be sure. Cloudflare settings that affect crawling.

A related problem: robots.txt that will not load

A missing robots.txt is harmless: Google treats any 4xx answer except 429 as if there were no robots.txt at all, and crawls everything. 28 of the sites we checked had none. A robots.txt that errors is different: a 429 or 5xx response is treated as a server error, and Google holds back from crawling the site, then works from its last copy of the file. 17 sites in our check returned an error for robots.txt, 15 of them "429 Too Many Requests", usually a firewall rate limit.

Questions

Is "Indexed, though blocked by robots.txt" bad for SEO?

It means Google is listing a page it cannot read, so it usually shows with little or no description. If you want the page in search, unblock it so Google can show it properly. If you do not, use noindex as above.

How long does a robots.txt change take?

Google generally caches robots.txt for up to 24 hours. After that it uses your new rules on its next crawl of each page.

Day 19 of 20. The free AI visibility checker tests your robots.txt against Googlebot, Bingbot and the AI crawlers at once. Templates for a safe file: robots.txt examples.

Want to know what AI crawlers see on your site? Our free AI visibility checker runs these checks against any page in about 10 seconds, no signup. If it finds something you'd rather hand over, our AI SEO service fixes it.

More from the blog

Get a free homepage mockup

Tell us about your business and we'll design a custom homepage concept within 48 hours — free, no strings attached.