robots.txt and Googlebot: how a blocked crawl kills your application
A reviewer cannot approve a site they cannot read. Most crawl blocks are accidents left over from a staging build or copied from someone else's file.
6 min read · Last updated
What robots.txt does — and does not do
robots.txt is a plain text file at the root of your domain that tells compliant crawlers which paths they may request. It controls crawling, not indexing, and it is advisory: well-behaved crawlers obey it, malicious ones ignore it. It is not a security mechanism, and anything you disallow is still publicly reachable by anyone who knows the URL.
For an AdSense application it matters for one reason: if Googlebot is disallowed, Google cannot read your content, and a site whose content cannot be read cannot demonstrate value.
The two crawlers to care about
- Googlebot — the search crawler. This is what indexes your pages and what a content review depends on.
- Mediapartners-Google — the AdSense crawler. It reads pages to decide which ads are relevant. Blocking it does not stop ads from serving, but it makes them less relevant and therefore less valuable.
Both should be allowed across your public pages. There is no reason for a monetised content site to block either.
A file that works
- User-agent: *
- Allow: /
- Sitemap: https://example.com/sitemap.xml
That is the whole thing for most sites. Add specific Disallow lines only for paths that genuinely should not be crawled — admin areas, internal search result pages, checkout steps, endless filter permutations.
The lines that break applications
- Disallow: / under User-agent: * — blocks the entire site. This is the standard staging-site file, and it ships to production more often than anyone admits.
- A block specifically naming User-agent: Googlebot with Disallow: / — usually copied from a tutorial about blocking a misbehaving bot.
- Disallow: /blog/ or /guides/ on the exact directory holding your content, left over from a rebuild.
- Disallow: /*.js$ or /*.css$ — Google needs to render your pages; blocking assets makes a modern site look broken to the crawler and can affect mobile-usability judgements.
- Noindex: directives inside robots.txt. Google stopped supporting these years ago; they do nothing, and people who rely on them are often surprised in the opposite direction.
How matching actually works
Two rules trip people up. First, a crawler obeys exactly one group: the one whose user-agent token most specifically matches its own name. If there is a Googlebot group, Googlebot reads that group and completely ignores the wildcard group, including any Allow lines in it. Second, within the matching group, the most specific rule wins — a longer path pattern beats a shorter one, and on an exact tie Allow beats Disallow.
This is why adding a friendly Allow: / to the wildcard group does not rescue a Disallow: / sitting in a Googlebot-specific group above it. Fix the group that applies, not a different one.
The other block: noindex on the page
robots.txt is only half the story. A page can be perfectly crawlable and still carry a meta robots noindex tag in its head, or an X-Robots-Tag: noindex header from the server. Those genuinely remove the page from search results. Most CMSs have a 'discourage search engines' switch that sets exactly this, and forgetting to turn it off after launch is one of the most common reasons a finished site has no indexed pages.
A subtle trap: if you block a URL in robots.txt, Google cannot fetch it, so it cannot see a noindex tag on it either. To remove a page from search, allow the crawl and use noindex — never both.
Verifying it
- Open https://yourdomain.com/robots.txt in a private window and read it. If you get a 404, you have no file — that is fine and means everything is crawlable.
- Check for any Disallow: / and for any group naming Googlebot.
- View the source of a content page and search for 'noindex'.
- In Search Console, use URL Inspection on a real content URL and confirm it reports the page as indexable.
- Run the domain through an automated checker for a second opinion on the file's presence, status code and Googlebot rules.
Frequently asked questions
- Do I need a robots.txt file at all?
- No. A missing robots.txt returns 404 and crawlers treat the whole site as allowed. A file is useful mainly for pointing at your sitemap and excluding specific paths.
- Should I block Mediapartners-Google?
- No. It is the AdSense crawler that determines ad relevance. Blocking it does not stop ads, it just makes them less targeted and typically less profitable.
- Will robots.txt remove a page from Google?
- Not reliably. A disallowed URL can still appear in results without a description if other sites link to it. To remove a page, allow crawling and add a noindex meta tag.
- Why are none of my pages indexed even though robots.txt looks fine?
- Check for a sitewide noindex tag or X-Robots-Tag header, a CMS 'discourage search engines' setting, or an unverified property in Search Console. Also confirm the site is new enough that Google simply has not crawled it yet.
Check your own site
Run the free checker to see where your site stands on HTTPS, ads.txt, robots.txt, sitemap, viewport, policy pages, content depth and page speed.
Run the checker