How to check if robots.txt is blocking Google

By the SEOAlertly team · Updated · 7 min read

Your robots.txt file tells crawlers which parts of your site they may visit. One wrong line can stop Google from crawling your whole website. Here is how to read the file, test it and fix the mistakes that cause the most damage.

Where to find robots.txt

It always lives at the root of the host: https://example.com/robots.txt. Open that address in your browser. Each subdomain needs its own file, so shop.example.com does not use the file from example.com.

How to read it

User-agent: *
Disallow: /admin/
Disallow: /cart
Allow: /admin/help

User-agent: Googlebot
Disallow: /internal-search

Sitemap: https://example.com/sitemap.xml

The rules that block Google

RuleEffect
Disallow: /Blocks the entire site
Disallow: (empty)Blocks nothing
Disallow: /blogBlocks /blog, /blog/post and also /blog-news
Disallow: /*?Blocks every URL with a query string
Disallow: /*.js$Blocks JavaScript files, which can stop Google rendering your pages

The classic accident is a staging file containing Disallow: / that goes live with the site. If your traffic dropped right after a launch or migration, check this first.

robots.txt blocks crawling, not indexing

A disallowed URL can still appear in Google if other pages link to it. It shows up with no description, and Search Console reports it as “Indexed, though blocked by robots.txt”. To keep a page out of results, allow crawling and use a noindex tag instead. Google has to crawl the page to see the noindex.

How to test whether Google is blocked

  1. Search Console robots.txt report: under Settings › robots.txt, you can see the version Google last fetched, when it fetched it and any parsing errors.
  2. URL Inspection: inspect a specific URL. If crawling is not allowed, the result says the page is blocked by robots.txt.
  3. SEOAlertly: a site check confirms robots.txt is reachable and flags a critical finding if a wildcard or Googlebot group disallows the whole site. It is a basic check: complex Allow and wildcard rules still deserve a manual review.

Other robots.txt mistakes to fix

A safe starting robots.txt

For most small sites, this is enough:

User-agent: *
Disallow: /admin/
Disallow: /cart
Disallow: /checkout

Sitemap: https://example.com/sitemap.xml

Replace the paths with your own private areas, or leave only the Sitemap line if there is nothing to block.

After you fix it

Google usually re-reads robots.txt within about a day. You can ask for a faster refresh from the robots.txt report in Search Console. Then request indexing for your most important pages. If pages are still missing, work through the other reasons a page is not indexed.

Related guides