Search tools...
SEO Tools

Robots.txt Generator Guide: Control Search Engine Crawling (2026)

Create a robots.txt file to tell search engines which pages to crawl and which to skip — prevent indexing of admin pages, duplicates, and private content.

9 min readUpdated April 9, 2026SEO, Developer, Web, Crawling

A robots.txt generator creates the robots.txt file that tells search engine crawlers (Google, Bing, Yandex) which parts of your website they are allowed to crawl and index, and which parts they should ignore.

Every website needs a robots.txt file. Without one, crawlers access everything — including admin panels, duplicate content, staging URLs, and internal search results pages that dilute your SEO. This guide explains the syntax, common rules, and how to generate the right robots.txt for your site.

Free Tool

Generate Your robots.txt File

Select your website type, add disallow rules, include your sitemap, and download a ready-to-use robots.txt file.

Open Robots.txt Generator ->

What Is robots.txt?

robots.txt is a plain text file placed at the root of your website (example.com/robots.txt) that gives instructions to web crawlers. It follows the Robots Exclusion Protocol — an internet standard since 1994.

Basic Syntax

User-agent: *
Disallow: /admin/
Disallow: /private/
Allow: /public/
Sitemap: https://example.com/sitemap.xml
DirectivePurposeExample
User-agentWhich crawler this rule applies to* (all), Googlebot, Bingbot
DisallowBlock this path from crawling/admin/, /api/, /tmp/
AllowOverride a disallow for a sub-path/admin/public-page
SitemapLocation of your XML sitemaphttps://example.com/sitemap.xml
Crawl-delaySeconds between requests (not Google)10 (for Bingbot, Yandex)
robots.txt Does Not Hide Pages

robots.txt prevents crawling, not indexing. If other pages link to a disallowed URL, Google may still index it (showing "No information is available for this page"). Use noindex meta tag or X-Robots-Tag header to prevent indexing.

Common robots.txt Rules by Website Type

Different types of websites need different robots.txt configurations:

WordPress Blog

User-agent: *
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /wp-content/plugins/
Disallow: /tag/
Disallow: /author/
Disallow: /?s=
Allow: /wp-admin/admin-ajax.php
Sitemap: https://example.com/sitemap_index.xml

E-commerce (Shopify/WooCommerce)

User-agent: *
Disallow: /cart
Disallow: /checkout
Disallow: /account
Disallow: /search
Disallow: /collections/*?sort_by=
Disallow: /collections/*?filter=
Sitemap: https://example.com/sitemap.xml

SPA / React / Next.js App

User-agent: *
Disallow: /api/
Disallow: /_next/
Disallow: /dashboard/
Disallow: /settings/
Sitemap: https://example.com/sitemap.xml

What to Block and What to Allow

Getting this wrong either wastes your crawl budget or hides important pages. Here is a decision framework:

Block These

PathWhy Block
/admin/, /dashboard/Internal admin panels — no SEO value
/api/API endpoints — not user-facing pages
/cart, /checkoutUser-specific pages — should not be indexed
/search, /?s=, /?q=Internal search results — creates infinite crawl paths
/tmp/, /staging/Temporary or test content
Duplicate content pathsURL parameters creating duplicate pages (?sort=, ?filter=)

Never Block These

  • CSS and JavaScript files — Google needs these to render your pages correctly. Blocking them hurts mobile-first indexing.
  • Images you want indexed — Block only private images, not product photos or blog images.
  • Your main content pages — Blog posts, product pages, landing pages should always be crawlable.
Crawl Budget

Google allocates a crawl budget to each site. Blocking low-value pages (search results, filtered pages, admin) lets Google spend more budget on your important pages.

Common robots.txt Mistakes

These mistakes can tank your SEO or expose private content:

MistakeImpactFix
Disallow: / (blocking everything)Entire site disappears from GoogleRemove or limit to specific paths
Blocking CSS/JS filesGoogle cannot render pages, hurts rankingsAllow all CSS/JS
No sitemap referenceGoogle may miss important pagesAdd Sitemap: directive
Using robots.txt for securityPages are still accessible via direct URLUse authentication, not robots.txt
Trailing slash confusion/admin blocks /admin/ and /admin-pageUse /admin/ with trailing slash
Forgetting staging subdomainstaging.example.com gets indexedAdd robots.txt to staging with Disallow: /
The Biggest Mistake

Using Disallow: / on your production site. This single line removes your entire website from search engines. Always double-check before deploying.

Testing Your robots.txt

After generating your robots.txt, test it before deploying:

  1. Google Search Console — Use the robots.txt Tester (Settings > robots.txt) to check if specific URLs are blocked or allowed
  2. Manual check — Visit yoursite.com/robots.txt in a browser to verify the file is accessible and formatted correctly
  3. Test specific URLs — For each important page, verify it is not accidentally blocked
  4. Check after deployment — Confirm the file is at the root domain, not in a subdirectory

Debugging Checklist

  • File is at the root: example.com/robots.txt (not example.com/pages/robots.txt)
  • File is plain text (not HTML)
  • No BOM (Byte Order Mark) at the start of the file
  • Directives are case-sensitive: "Disallow" not "disallow"
  • Each directive on its own line

Blocking AI Crawlers (GPTBot, CCBot, Google-Extended)

With the rise of AI training, many website owners want to block AI crawlers from scraping their content:

# Block AI training crawlers
User-agent: GPTBot
Disallow: /

User-agent: CCBot
Disallow: /

User-agent: Google-Extended
Disallow: /

User-agent: anthropic-ai
Disallow: /

# Allow regular search engines
User-agent: Googlebot
Allow: /

User-agent: Bingbot
Allow: /

This blocks AI companies from using your content for model training while keeping your site fully accessible to search engines for normal indexing and ranking.

Not All AI Crawlers Obey

robots.txt is advisory — well-behaved crawlers (Google, OpenAI, Anthropic) respect it, but not all scrapers do. For stronger protection, use server-side bot detection and rate limiting.

How to Use the Tool (Step by Step)

  1. 1

    Select Website Type

    Choose your platform — WordPress, e-commerce, SPA, or custom — to get recommended rules.

  2. 2

    Add Disallow Rules

    Specify which paths to block from crawlers — /admin/, /api/, /cart, /search, etc.

  3. 3

    Add Sitemap URL

    Enter the URL of your XML sitemap so crawlers can discover all your pages.

  4. 4

    Generate and Download

    Generate the robots.txt file and download it. Upload to your website root directory.

  5. 5

    Test in Google Search Console

    Use the robots.txt Tester to verify your rules work correctly for important URLs.

Frequently Asked Questions

What is a robots.txt file?+

A plain text file at your website root (example.com/robots.txt) that tells search engine crawlers which pages to crawl and which to skip. It follows the Robots Exclusion Protocol.

Does every website need a robots.txt?+

Yes. Without one, crawlers access everything including admin pages, search results, and duplicate content. Even a simple robots.txt with a sitemap reference improves crawl efficiency.

Does robots.txt block pages from Google search results?+

No. It prevents crawling, not indexing. Google may still index a blocked URL if other pages link to it. Use a noindex meta tag to prevent a page from appearing in search results.

What happens if I use Disallow: /?+

This blocks your entire website from all crawlers. Your site will disappear from search results. Never use this on a production site unless intentional (e.g., staging environments).

Should I block CSS and JavaScript in robots.txt?+

No. Google needs CSS and JS files to render your pages correctly for mobile-first indexing. Blocking them can significantly hurt your search rankings.

How do I block AI crawlers like GPTBot?+

Add separate User-agent blocks for GPTBot, CCBot, Google-Extended, and anthropic-ai with Disallow: /. This blocks AI training crawlers while keeping search engines allowed.

Where do I upload the robots.txt file?+

Place it at the root of your domain: example.com/robots.txt. It must be accessible at this exact path — not in a subdirectory.

Is this robots.txt generator free and private?+

Yes. The generator runs in your browser. No website data or URLs are sent to any server.

Free — No Signup Required

Generate Your robots.txt File

Select your website type, add disallow rules, include your sitemap, and download a ready-to-use robots.txt file.

Open Robots.txt Generator ->

Related Guides