Robots.txt Generator

Compose crawl rules for compliant search engines and bots. Generation runs in your browser - Compathub does not publish or host your robots.txt file.

Robots.txt generator illustration
Compathub tool

Generate robots.txt

Set user-agent groups, allow/disallow paths and sitemap URLs. The preview updates as you edit.

Used for context and to suggest sitemap URLs. Use a full http:// or https:// address.

Presets

User-agent groups

Each group applies Allow and Disallow rules to the listed user-agents until the next group.

Sitemap URLs

Sitemap directives must be absolute http:// or https:// URLs (often listed once at the end of the file).

Live preview


                        

Upload the file to your website root (for example https://example.com/robots.txt) for compliant crawlers to read it. Downloading here does not publish the file. Rules do not secure private content or guarantee rankings.

What robots.txt is (and is not)

It is a plain-text policy file for crawlers that choose to follow it - not a firewall or authentication layer.

Standard directives only

This tool outputs User-agent, Allow, Disallow and Sitemap lines supported by major crawlers - not vendor-specific extensions.

Warnings on risky rules

We flag site-wide blocks and paths that often cover CSS or JavaScript so you can avoid accidental crawl or rendering issues.

Client-side only

Your rules never leave the browser during generation. You control upload to your own server.

What this tool creates

robots.txt is a plain-text file at the root of a host (for example https://example.com/robots.txt) that tells well-behaved crawlers which paths they should or should not request. This generator runs entirely in your browser: you build groups, preview the file, then copy or download it. Compathub does not upload it to your server.

Robots.txt is not authentication. It does not stop people from visiting URLs directly, and not every bot obeys it.

Directives supported here

  • User-agent - names the crawler group (for example * for all agents, or a specific product name).
  • Allow / Disallow - path prefixes relative to the site root. The preview warns on risky patterns such as blocking all of / or common asset paths.
  • Sitemap - absolute URL(s) pointing at your XML sitemap(s), one per line in the output.

Lines after a User-agent line belong to that group until the next group begins. You can add multiple user-agent lines in one group when they share the same rules.

Example rules (illustrative)

RuleEffect for compliant crawlers
Disallow: /admin/Discourages crawling URLs under /admin/ - still not a substitute for login protection.
Allow: /public/ with narrower disallows elsewhereHelps express exceptions when you use broad disallow patterns (behaviour depends on crawler).
Sitemap: https://example.com/sitemap.xmlAdvertises where your sitemap lives; does not create the sitemap file itself.

Crawl control vs removing pages from search results

Blocking a URL in robots.txt asks crawlers not to fetch it. That is different from removing a URL from a search index. If a URL is blocked, some crawlers may never see a noindex directive on the page itself - Google documents this interaction in Search Central guidance on robots meta tags.

To keep a page off results while staying crawlable, use on-page noindex (and remove internal links), not robots.txt alone.

Do not block rendering assets without reason

Disallowing CSS, JavaScript, or image paths can interfere with how crawlers render pages. Block only paths you deliberately want unfetched, and test after publishing.

Before you publish

  1. Confirm the file is served at the root of the correct host (www vs apex each need their own file unless one redirects to the other).
  2. Validate syntax in the live preview; fix warnings about site-wide blocks.
  3. Fetch /robots.txt in a browser or use Search Console’s robots report after upload.
  4. Add your sitemap URL - build the XML with the XML Sitemap Generator if needed.

FAQ

Does Compathub host my robots.txt? No - you download and deploy it.

Is this llms.txt? No - llms.txt is an optional documentation-style file for humans and tools, not crawl permission rules.

Need a sitemap URL to list? Use the XML Sitemap Generator, then paste the absolute sitemap address into the Sitemap field here.