User-agent: * Disallow: /admin Allow: /
What is robots.txt?
robots.txt is a plain-text file at the root of your domain (e.g. https://yoursite.com/robots.txt) that crawlers check before requesting anything else on your site. It uses User-agent blocks to target specific crawlers (Googlebot, Bingbot, or * for all of them) and Disallow/Allow rules to say which paths they may or may not fetch. It's a request, not an access-control mechanism — well-behaved crawlers honor it, but it doesn't block anyone from reaching a URL directly, and it doesn't prevent a page from being indexed if other sites link to it.
When to use it
Use robots.txt to keep crawlers out of admin panels, staging paths, internal search-result pages, and duplicate content generated by filters or session IDs — this keeps your crawl budget focused on pages you actually want indexed instead of wasted on infinite parameter combinations. Add a Sitemap directive pointing to your sitemap.xml so crawlers discover it without you submitting it separately per crawler, and a Host directive if you need to declare a preferred domain (mainly relevant for Yandex).
Don't use Disallow to try to keep a page out of Google's index — if it's linked from elsewhere, Google can still index the URL (without a snippet) even if it never crawls the content. Use a noindex meta tag on the page itself for that.
Example
A typical setup for a SaaS marketing site: User-agent * with Disallow: /admin and Disallow: /app (the logged-in product, which shouldn't be crawled), Allow: / for everything else, plus Sitemap: https://harborlytics.io/sitemap.xml. Add a second User-agent block targeting a specific bot (e.g. an aggressive AI scraper) with its own Disallow rules if you need different treatment per crawler.
How to use the robots.txt Generator tool
- 1
Add a rule per crawler
Use * to target all crawlers, or a specific user-agent string to give one bot different rules.
- 2
List Disallow and Allow paths
Disallow blocks a path prefix; Allow carves out exceptions within a disallowed path.
- 3
Add your sitemap and host
The Sitemap directive helps crawlers find your XML sitemap without manual submission per engine.
- 4
Copy, download or share
Copy the output to public/robots.txt at your domain root, or share a permalink with your exact rules.
Frequently asked questions
Does robots.txt stop a page from being indexed?
No. It only stops crawling. A disallowed page can still appear in search results (typically with no snippet) if other pages link to it. To prevent indexing, use a noindex meta tag or header on the page itself — but note that Google can't see a noindex tag on a page it's blocked from crawling, so don't combine Disallow and noindex on the same URL.
Where does robots.txt need to live?
At the root of the domain exactly — https://yoursite.com/robots.txt. A copy at /blog/robots.txt or on a subdomain only applies to that subdomain, not the whole site.
What's a common mistake that blocks an entire site by accident?
A stray Disallow: / left over from a staging environment blocks all crawling of the whole domain. Always double check the root Disallow rules before deploying to production.
Is this generated locally or sent to a server?
Entirely locally. The rules you enter are assembled into the robots.txt text in your browser; nothing is uploaded.
Related on TechLogHub
Related SEO Tools
Meta Tag Generator
Generate HTML meta tags for SEO
OpenGraph Tag Generator
Generate OpenGraph meta tags for social sharing
sitemap.xml Generator
Generate XML sitemaps for search engines
Canonical Tag Generator
Generate canonical link tags to prevent duplicate content
FAQ Schema Generator
Generate FAQPage structured data (JSON-LD) — no longer a Google rich result
HowTo Schema Generator
Generate HowTo structured data (JSON-LD) — Google retired the rich result in 2023
Get the next tool before you need it
One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.

