Skip to main content

Robots.txt Generator

Generate optimized robots.txt files instantly. Control search engine crawling, configure sitemaps, and safeguard your SEO performance.

Advertisement

Rules Builder

Presets:

Default Access (All Bots)

Sitemap

Custom Bot Rules

robots.txt Output
File Generated
Lines: 0 Size: 0 B

Advertisement

Writing Clean Robots.txt Directives Without Breaking Crawl Access or Hiding Indexing Signals

Two mistakes dominate technical SEO migrations every year. In one scenario, a staging site pushes live with Disallow: / still sitting at the domain root, locking search crawlers out of every product and blog page overnight. In the opposite scenario, a team tries hiding a private confirmation page or test report by adding it to robots.txt, unaware that robots.txt governs crawling, not search indexing or visitor security.

Anyone on the internet can open https://yourdomain.com/robots.txt in a browser tab and read every listed path. Treat it strictly as traffic routing for polite crawlers (following RFC 9309): steering Googlebot, Bingbot, Applebot, DuckDuckBot, and AI crawlers away from faceted filter loops or checkout carts while pointing cleanly toward your XML sitemap. Bear in mind also that robots.txt applies per protocol, subdomain, and port: placing rules at https://example.com/robots.txt does not govern https://staging.example.com or a separate blog subdomain, so each host needs its own root file (or login protection for staging hosts). Anything requiring genuine privacy belongs behind authentication or server rules rather than a public text file.

Rule Precedence Traps: Bot Inheritance and Longest Pattern Matching

Many unexpected indexing drops happen not from typos in paths, but from misunderstanding how crawlers interpret multiple User-agent groups in the same file:

Robots.txt Behavior Common Assumption Actual Crawler Rule (RFC 9309)
Specific bot group plus wildcard group Googlebot reads * rules and merges custom overrides Once a specific User-agent: Googlebot group exists, Googlebot skips User-agent: * completely
Overlapping Allow and Disallow Whichever line appears higher in the file wins Longest matching path prefix wins regardless of line order (Allow breaks ties cleanly)
Disallow paired with HTML noindex Blocking both keeps URLs completely out of Google Disallowing crawling stops Googlebot from reading the noindex tag, leaving linked URLs indexed bare
Crawl-delay throttling Slows every search bot evenly Supported by Bingbot and Yandex, yet completely ignored by Googlebot

That first rule is worth double checking whenever you add bot overrides in the builder above. Notice how rules entered under User-agent: * combine cleanly into the main wildcard section, while picking bots such as Googlebot, Bingbot, ChatGPT-User, or CCBot generates a dedicated block. If you create a dedicated Googlebot block simply to allow one folder, repeat any important Disallow: exclusions inside that block too so Googlebot still sees them. Notice prefix matching carefully as well: writing Disallow: /search without a trailing slash accidentally blocks a public article at /search-tips/, so append a trailing slash (/search/) or an end anchor ($) whenever you only mean a single folder or route.

Starter Presets, Live Warnings, and Clean Output Example

You can start immediately from the toolbar presets (configured for content blogs, online shops blocking /checkout/ and /*?filter= sort parameters, or SaaS apps excluding /app/ and /api/) and tailor paths interactively. Beneath the rules list, an automated warning checker scans your draft in real time and alerts you if default access blocks all bots, if your Sitemap: URL is missing or uses a relative path instead of full https:// format, or if custom directory strings omit their opening slash /.

Configuration Goals
Default Rule: Allow all public pages
Wildcard Exclusions: /admin/, /cart/, /*?sort=
AI Scraper Rule: Block CCBot across /
Sitemap URL: https://www.blackclaaw.com/sitemap.xml
Generated robots.txt Output
User-agent: *
Allow: /
Disallow: /admin/
Disallow: /cart/
Disallow: /*?sort=

User-agent: CCBot
Disallow: /

Sitemap: https://www.blackclaaw.com/sitemap.xml

Do Not Block CSS, JavaScript, or CDN Assets

Back in early search optimization guides, site owners frequently added Disallow: /assets/, Disallow: /css/, or Disallow: /js/ thinking it saved crawl bandwidth. Today, Googlebot executes JavaScript and renders every layout through a modern headless Chromium browser to evaluate Core Web Vitals, mobile responsiveness, and structured markup. Blocking CSS or JS directories prevents Google from rendering the page cleanly and directly hurts rankings.

If runaway scraper traffic hits database endpoints or rate limits your origin server, enforce rules at the firewall edge (such as Cloudflare WAF or Nginx rate limiting) rather than relying on polite robots.txt directives or deprecated Crawl-delay lines that abusive bots skip anyway. When exporting your finished rules, clicking the download button saves cleanly as lowercase robots.txt so case sensitive Linux hosts and CDN origins serve /robots.txt without returning 404 (keep total file size crisp as well, since Googlebot enforces a 500 KiB ceiling per file). Always validate your sitemap URL itself using our Sitemap Generator and confirm sitemap files resolve with HTTP 200 OK rather than redirect hops via the Redirect Checker.

Robots.txt Directives FAQs

Q: Does Disallow in robots.txt prevent a page from appearing in Google?

No! Disallow stops Googlebot from crawling the page, yet if external pages link to that URL, Google can still index it as a bare URL entry without any snippet. Leave the page crawlable and serve <meta name="robots" content="noindex, follow"> or an X-Robots-Tag HTTP header instead.

Q: Where must the robots.txt file be hosted?

Place the plain UTF-8 file directly at the exact root path of each host protocol and domain: https://www.example.com/robots.txt. Putting it inside subdirectories like /docs/robots.txt causes crawlers to ignore it completely.

Q: Does robots.txt support wildcard characters?

Yes. Major crawlers recognize * (matching zero or more characters) and $ (anchoring the end of the path). For instance, Disallow: /*.pdf$ excludes PDF URLs while keeping pages whose slugs merely contain the letters pdf accessible.

Q: Can malicious bots ignore my robots.txt directives?

Yes. robots.txt is voluntary crawler etiquette followed by search engines like Google, Bing, and DuckDuckGo. Abusive scrapers and vulnerability scanners ignore it entirely, so block private routes with authentication and server or edge firewall rules.

Q: Are robots.txt directives case-sensitive?

Yes. All URL path patterns are strictly case sensitive: Disallow: /Admin/ blocks /Admin/users while still allowing /admin/users, whereas bot user agent names themselves are matched case insensitively.

Related Technical SEO Tools