Technical SEO → Robots.txt
Robots.txt:
One Bad Line Can Kill Your Entire Site.
The robots.txt file controls which parts of your site Google can crawl. It's small, powerful, and one of the most dangerous files on your server — a single misconfigured directive can block Google from your entire domain overnight.
The Difference
A Correct robots.txt vs. a Broken One
The difference between a safe robots.txt and a catastrophic one can be a single character. Here's what each looks like — and why the broken version is more common than you'd think (it ships by default on some CMS staging environments).
# All crawlers
User-agent: *
Disallow: /wp-admin/
Disallow: /search/
Disallow: /cart/
Disallow: /thank-you/
Allow: /wp-admin/admin-ajax.php
Sitemap: https://example.com/sitemap.xml
✓ Blocks only non-essential paths
# All crawlers
User-agent: *
Disallow: /
✗ Blocks Google from your entire site
Critical Distinction
robots.txt
Controls crawling — whether Google can visit the page. Blocked pages can still appear in search results if other sites link to them.
Noindex tag
Controls indexing — whether Google includes the page in search results. Use this to truly exclude a page from rankings.
Checklist
- Robots.txt accessible at /robots.txt
- No important pages or directories disallowed
- No 'Disallow: /' in production
- Sitemap URL referenced in robots.txt
- Admin and login paths are disallowed
- Robots.txt tested in GSC after any changes
- User-agent directives correctly formatted
- Staging environment blocked from crawling
The Reference
robots.txt Directive Reference
Every robots.txt file uses the same small set of directives. Here's what each one does and how it's written.
| Directive | What It Does | Example |
|---|---|---|
| User-agent: * | Applies the following rules to all crawlers | User-agent: * |
| User-agent: Googlebot | Applies rules only to Google's crawler | User-agent: Googlebot |
| Disallow: /path/ | Blocks crawling of the specified path and everything under it | Disallow: /wp-admin/ |
| Disallow: / | Blocks crawling of the entire site — the catastrophic mistake | Disallow: / ← DANGER |
| Allow: /path/ | Explicitly permits crawling of a path (overrides a broader Disallow) | Allow: /wp-admin/admin-ajax.php |
| Sitemap: | Points crawlers to your XML sitemap location | Sitemap: https://example.com/sitemap.xml |
The Test
How To Test Your robots.txt
Never edit your robots.txt without testing it first. Google Search Console gives you a free robots.txt tester built directly into the platform.
View Your Current robots.txt
Visit yourdomain.com/robots.txt in a browser. Every directive should be visible. If the page returns a 404, Google treats it as a file with no restrictions — that's fine, but you may still want one for sitemap reference and admin blocking.
Use GSC's URL Inspection Tool
In Google Search Console, enter a URL you suspect might be blocked. The URL Inspection result shows whether the page is 'Allowed' or 'Blocked by robots.txt' under the Crawl section. This is the fastest way to check a specific URL.
Test Before Every Edit
GSC's robots.txt tester (under Settings → robots.txt) shows you how Google interprets your current file and lets you test specific URLs against proposed changes before deploying. Use it every time you edit the file.
Check After Site Updates
CMS updates, plugin installs, and staging-to-production deployments can silently overwrite your robots.txt. Add robots.txt review to your deployment checklist — it takes 30 seconds and prevents catastrophic ranking drops.
Make Sure Your robots.txt Isn't Blocking What It Shouldn't
A free technical SEO audit reviews your robots.txt file against your site structure — flagging any directives that block pages you need Google to crawl and index.
Get My Free AuditFAQ
Common Questions About Robots.txt
What is a robots.txt file used for?
A robots.txt file is a plain text file placed at the root of your domain (yourdomain.com/robots.txt) that communicates crawling instructions to search engine bots. It tells crawlers which pages or directories to access and which to skip. Common uses include: blocking admin and login pages from being crawled, preventing search result or filtered pages from wasting crawl budget, keeping staging environments out of search results, and referencing the location of your XML sitemap. It is not a security tool and should not be used to hide sensitive data.
Does robots.txt actually work?
Yes — for compliant crawlers like Googlebot, Bingbot, and other major search engine bots. These crawlers respect the Robots Exclusion Protocol and follow robots.txt directives. However, robots.txt only controls crawling, not indexing. A page blocked from crawling can still appear in Google's index if other sites link to it — Google can infer the page exists from external links without being able to read its content. For true exclusion from search results, use a noindex meta tag, which controls indexing regardless of crawling status.
Is robots.txt still a thing?
Yes — robots.txt remains a standard and actively used technical SEO tool in 2025. Google continues to respect and process robots.txt directives for all sites. Its role has evolved: for small business sites with a few hundred pages, crawl budget is rarely a limiting factor, so robots.txt is primarily used to block admin areas, staging paths, and duplicate content generators rather than to manage crawl budget. For large e-commerce or content sites with thousands of URLs, robots.txt is still critical for preventing crawl waste on low-value parameterized or paginated URLs.
When should you use a robots.txt file?
Use robots.txt to block pages you want crawled less frequently or not at all — but that don't need to be completely hidden from search results. Appropriate uses include: blocking /wp-admin/ and other admin directories, preventing crawling of internal search result pages (/search?q=), keeping paginated or filtered category pages from using crawl budget, and excluding utility pages like /thank-you/ or /cart/. Do not use robots.txt as your only mechanism for keeping sensitive pages out of Google — pair it with noindex tags for anything that must never appear in search results.
What does 'blocked' by robots.txt mean?
A page 'blocked' by robots.txt means Googlebot cannot access or read its content because a Disallow directive applies to that URL. In Google Search Console's URL Inspection tool, blocked pages show as 'Crawled — currently not indexed' or 'Blocked by robots.txt.' Being blocked does not mean the URL disappears from Google's awareness — if other sites link to it, Google knows it exists. It does mean Google can't read the page's content to evaluate it for indexing.
How often do Google robots crawl a site?
There's no fixed crawl schedule — Google crawls each site based on its crawl budget, which is influenced by page authority, site speed, and how frequently your content changes. For most small business sites with a few dozen to a few hundred pages, Googlebot may revisit key pages every few days to a few weeks. Frequently updated content (like a news blog) gets crawled more often. You can request faster crawling of specific URLs using the URL Inspection tool in Google Search Console — this is useful after publishing new pages or making significant content updates.
A Safe robots.txt Is a Non-Negotiable Foundation.
Griffin Mott Consulting audits robots.txt files for small businesses in Kansas City and ensures nothing critical is blocked. Start with a free audit.