robots.txt Generator
Build a correct robots.txt — per-agent rules, crawl-delay, and sitemap — with copy-ready output. Common presets included.
Build a correct robots.txt with per-agent rules, crawl-delay, and a sitemap line — grouped exactly the way crawlers read them, with presets for the three requests every site eventually makes: allow everything, block the private area, and block AI crawlers.
How to use robots.txt Generator
- Start from a preset or add rules one by one.
- Add your sitemap URL and any crawl-delay.
- Copy or download the file to your site root.
Who it is for
Site owners publishing their first robots.txt, developers adding rules for a new bot, and teams managing AI-crawler permissions as policies evolve.
How it works
- Rules group under their User-agent blocks in standard order, so the output is valid on the first try.
- Presets include the current AI-crawler agents (GPTBot, CCBot, Google-Extended) — one click, editable afterwards.
- The sitemap line and an optional crawl-delay complete the file, with a one-click download.
What it cannot do
- robots.txt is a request, not enforcement — honest crawlers obey it; the only real block is server-side auth.
- Crawl-delay is ignored by Google (use Search Console settings) but honored by several other crawlers.
Sample input & output
Preset: Allow search engines, block /admin/ and /api/, block GPTBot, and declare https://example.com/sitemap.xml
User-agent: * Disallow: /admin/ Disallow: /api/ User-agent: GPTBot Disallow: / Sitemap: https://example.com/sitemap.xml
Frequently asked questions
Why is my blocked page still appearing in Google?
robots.txt blocks CRAWLING, not indexing — a page that was already indexed can show as a URL-only result. Use noindex meta for removal.
Does Disallow hide my site from Google entirely?
Only the paths you list. A bare "User-agent: * / Disallow:" with nothing after it means allow-everything; a "/" after it blocks the whole site.
Where must the file live?
Exactly at https://your-domain/robots.txt — never in a subfolder.
How does RFC 9309 resolve conflicts when both Allow and Disallow match a URL?
Under IETF RFC 9309 (Robots Exclusion Protocol), crawlers select the most specific User-agent group that matches their token — they do NOT merge User-agent: * rules into a named bot's group — and within that group they match paths by longest prefix length in octets. If Allow: /public/docs and Disallow: /public/ both match, Allow wins because 12 bytes exceeds 8; on equal length, Allow takes precedence.
Why should you NOT block CSS and JavaScript asset folders in robots.txt?
Googlebot renders modern pages using a headless evergreen Chromium Web Rendering Service (WRS). Blocking /assets/, /static/, or *.js and *.css in robots.txt prevents Googlebot from loading stylesheets and layout scripts, causing mobile-usability rendering failures, hidden-content misclassifications, and broken client-rendered DOM trees that directly hurt rankings.
What is the difference between blocking GPTBot, Google-Extended, and Googlebot?
Disallowing User-agent: Googlebot removes your site from Google Search crawling entirely, whereas User-agent: Google-Extended is a standalone opt-out token covering Gemini training and grounding datasets without affecting Google Search rankings. Similarly, GPTBot controls OpenAI model-training crawls while OAI-SearchBot governs search citations; remember to repeat any /admin/ rules inside each named User-agent block you add.
What happens if https://example.com/robots.txt returns HTTP 404 versus HTTP 500?
Per RFC 9309, if /robots.txt returns any 4xx client error (such as 404 Not Found or 410 Gone) other than 429, crawlers treat the site as completely unrestricted and crawl everything. Conversely, if your server returns a 5xx error (500, 502, 503) on /robots.txt, Googlebot assumes a temporary outage and halts all crawling of the entire host to avoid accidentally fetching restricted paths.