🤖">

Robots.txt Generator

Robot exclusion protocol • Crawl configuration • 2026 edition

Robots.txt Syntax:

Show the generator

Basic Structure:

User-agent: *

Disallow: /private/

Allow: /public/

Crawl-delay: 10

Sitemap: https://example.com/sitemap.xml

Where:

  • User-agent: Specifies which crawler the rules apply to
  • Disallow: Blocks access to specified paths
  • Allow: Allows access to specific paths
  • Crawl-delay: Sets delay between requests (seconds)
  • Sitemap: Points to sitemap location

Robots.txt follows the Robot Exclusion Protocol to control web crawler access.

Website Configuration

User-Agent Selection

All Crawlers (*)
Googlebot
Bingbot
Yahoo Slurp
DuckDuckBot
YandexBot

Disallow Paths

Allow Paths

Crawl Settings

Current Directives

User-agent: * | Disallow: /private/
User-agent: * | Allow: /api/public/

Advanced Options

Generated Robots.txt

4
Total Directives
284 B
File Size
1
User Agents
1
Blocked Paths
✓ Valid Robots.txt Generated
# robots.txt generated for https://example.com # Created on: 2026-01-15 User-agent: * Disallow: /private/ Allow: /api/public/ Crawl-delay: 10 Sitemap: https://example.com/sitemap.xml

Directive Overview

  • User-agent: Specifies which crawler the rules apply to
  • Disallow: Blocks access to specified directories/files
  • Allow: Overrides Disallow for specific paths
  • Crawl-delay: Controls crawl rate (not supported by all bots)
  • Sitemap: Points to your XML sitemap location
Best Practices
  • Place robots.txt in your website root directory
  • Use absolute URLs for sitemap directive
  • Be specific with path exclusions
  • Test with search console tools
  • Remember: malicious bots may ignore robots.txt

Comprehensive Robots.txt Guide

What is Robots.txt?

Robots.txt is a text file that follows the Robot Exclusion Protocol to tell web robots which areas of your site they can access. It's placed in the root directory of your website and provides instructions to search engine crawlers about which pages or sections to exclude from indexing.

Basic Syntax

Essential robots.txt directives include:

User-agent: [crawler name]
Disallow: [path to block]
Allow: [path to allow]
Crawl-delay: [seconds]
Sitemap: [URL]

Each directive serves a specific purpose in controlling crawler behavior.

Best Practices for 2026
  • Security: Block sensitive directories like /admin/
  • Performance: Use crawl-delay to prevent server overload
  • SEO: Include sitemap directive for discovery
  • Specificity: Be precise with path exclusions
  • Testing: Use search console tools to validate
Common Patterns

Typical robots.txt configurations:

1
Public Site: Allow all, include sitemap
2
E-commerce: Block admin, cart, checkout paths
3
News Site: Control crawl rate for frequent updates

Robots.txt Standards

File Location

Must be placed at https://example.com/robots.txt (root directory).

File Format

Plain text file with UTF-8 encoding, maximum 500KB size.

Directive Limits:
  • Max 1000 directives per file
  • Max 500KB file size
  • Case-sensitive paths
  • Supports wildcards (*, $)

Configuration Tips

Path Matching

Use wildcards: /path/* matches all subdirectories.

Directive Priority
  1. More specific paths override general ones
  2. Allow directives override Disallow
  3. Order matters in some implementations
  4. Case sensitivity applies to paths
Important Notes:
  • Doesn't guarantee privacy
  • Malicious bots may ignore it
  • Use noindex for sensitive content
  • Test with search console

Robots.txt Configuration Learning Quiz

Question 1: Multiple Choice - Robots.txt Standards

Where must the robots.txt file be located to be recognized by web crawlers?

Solution:

The answer is B) At the root directory (https://example.com/robots.txt). The robots.txt file must be placed in the root directory of your website to be recognized by web crawlers. This is a fundamental requirement of the Robot Exclusion Protocol. Crawlers will specifically look for the file at https://yoursite.com/robots.txt, and placing it anywhere else will make it inaccessible to most search engine robots.

Pedagogical Explanation:

This question emphasizes a critical requirement of the robots.txt protocol. The location is standardized because search engine crawlers follow a predictable pattern when looking for the robots.txt file. They always check the root directory first, and if they don't find it there, they won't continue searching elsewhere. This standardization ensures consistency across the web and prevents confusion about where crawlers should look for crawling instructions.

Key Definitions:

Root Directory: The top-level directory of a website, accessible at the domain root

Robot Exclusion Protocol: Standard for controlling web robot behavior

Crawler Recognition: Ability of web crawlers to locate and parse robots.txt

Important Rules:

• Must be in root directory: /robots.txt

• Accessible via: https://domain.com/robots.txt

• Follows standardized protocol

Tips & Tricks:

• Always place in root directory

• Test accessibility with browser

• Use search console to verify

Common Mistakes:

• Placing robots.txt in subdirectories

• Using incorrect file permissions

• Not testing file accessibility

Question 2: Robots.txt Syntax Application

Which of the following robots.txt directives correctly blocks Googlebot from accessing the /admin/ directory while allowing access to the rest of the site?

Solution:

The correct directive is:

User-agent: Googlebot
Disallow: /admin/

This specifically targets Google's crawler and blocks access to the /admin/ directory while leaving all other paths accessible. The blank line after the User-agent line is optional but recommended for readability.

Pedagogical Explanation:

This demonstrates the specificity feature of robots.txt. You can target individual crawlers (like Googlebot, Bingbot) with their own set of rules. The syntax requires a User-agent line followed by the directives that apply to that specific crawler. When you specify a particular bot, other bots will follow different rules or the default rules for "all crawlers" (User-agent: *). This allows for fine-grained control over different search engines' access.

Key Definitions:

User-agent: Specifies which crawler the rules apply to

Specific Targeting: Applying rules to individual crawlers

Default Rules: Rules that apply to all crawlers (*)

Important Rules:

• Each User-agent section is independent

• Specific rules override general ones

• Case-sensitive user-agent names

Tips & Tricks:

• Use * for all crawlers

• Be specific with bot names

• Group related directives together

Common Mistakes:

• Using incorrect user-agent names

• Mixing rules for different agents

• Not understanding scope of rules

Question 3: Word Problem - Path Configuration

An e-commerce website wants to block search engine crawlers from accessing the following sensitive paths: /admin/, /cart/, /checkout/, and /orders/. However, they want to allow access to the /api/public/ directory for legitimate API access. Write the robots.txt directives that accomplish this, and explain the order of precedence for Allow and Disallow directives.

Solution:

The robots.txt directives would be:

User-agent: *
Disallow: /admin/
Disallow: /cart/
Disallow: /checkout/
Disallow: /orders/
Allow: /api/public/

Regarding precedence: In most implementations, Allow directives take precedence over Disallow directives when they conflict. If a path matches both an Allow and a Disallow rule, the Allow rule wins. However, the order can matter in some implementations, so it's generally safer to place more specific rules (like Allow) after general rules (like Disallow).

Pedagogical Explanation:

This demonstrates the practical application of robots.txt for e-commerce sites, which often have sensitive areas that shouldn't be indexed. The Allow directive is particularly useful for overriding more general Disallow rules. The precedence rule (Allow overriding Disallow) is important because it allows you to make exceptions to general blocking rules. This is especially valuable when you want to block a broad area but still allow access to specific parts of it.

Key Definitions:

Precedence: The order of importance when rules conflict

Override: One rule taking priority over another

Path Blocking: Preventing access to specific directories

Important Rules:

• Allow overrides Disallow in conflicts

• More specific paths take precedence

• Order can matter in some implementations

Tips & Tricks:

• Place specific rules after general ones

• Use Allow to create exceptions

• Test rules with search console

Common Mistakes:

• Not understanding Allow/Disallow precedence

• Blocking important content accidentally

• Not testing the configuration

Question 4: Application-Based Problem - Crawl Rate Optimization

A high-traffic news website publishes 100 articles per hour and has limited server resources. They want to control crawl rate to prevent server overload while ensuring fresh content gets indexed promptly. What robots.txt configuration would best balance these requirements, and how would the crawl-delay directive impact different search engines?

Solution:

Optimal robots.txt configuration:

User-agent: *
Crawl-delay: 5
Disallow: /temp/
Disallow: /drafts/

The Crawl-delay directive specifies minimum time (in seconds) between successive requests from the same crawler. However, support varies by search engine:

  • Google: Ignores Crawl-delay but respects server load
  • Bing: Respects Crawl-delay values
  • Other engines: Variable support

For Google specifically, use Search Console to manage crawl rate rather than relying on Crawl-delay.

Pedagogical Explanation:

This example highlights the reality that different search engines implement robots.txt directives differently. While Crawl-delay is part of the standard, not all major engines respect it. This demonstrates why it's important to understand the specific behaviors of different search engines rather than assuming universal compliance with the protocol. For Google, which handles the majority of searches, alternative methods like Search Console are more effective for crawl rate management.

Key Definitions:

Crawl-delay: Minimum time between crawler requests

Server Load: Resource consumption from crawling activity

Implementation Variance: Different behavior across search engines

Important Rules:

• Support varies by search engine

• Google ignores Crawl-delay

• Use Search Console for Google

Tips & Tricks:

• Understand each engine's behavior

• Use Search Console for Google control

• Monitor server logs for crawl activity

Common Mistakes:

• Assuming all engines respect all directives

• Relying solely on Crawl-delay for Google

• Not monitoring actual crawl behavior

Question 5: Multiple Choice - Robots.txt Limitations

Which of the following statements about robots.txt limitations is TRUE?

Solution:

The answer is B) Malicious bots and scrapers may ignore robots.txt entirely. Robots.txt is a voluntary protocol that ethical search engines follow, but malicious bots, scrapers, and other unauthorized crawlers can and often do ignore these directives. For true security and privacy, additional measures like password protection, IP restrictions, or the noindex meta tag should be used instead of or in addition to robots.txt.

Pedagogical Explanation:

This question addresses a common misconception about robots.txt. It's important to understand that robots.txt is a guideline, not a security mechanism. It works on an honor system with reputable search engines, but provides no technical barrier to access. This is why sensitive information should never rely solely on robots.txt for protection. The protocol is designed to help well-behaved crawlers respect website owners' wishes, not to enforce access controls.

Key Definitions:

Honor System: Voluntary compliance without enforcement

Security Mechanism: Technical protection method

Access Control: Methods to restrict resource access

Important Rules:

• Not a security tool

• Voluntary compliance

• Use additional protections for sensitive content

Tips & Tricks:

• Use noindex for private content

• Implement authentication for sensitive areas

• Combine with other security measures

Common Mistakes:

• Using robots.txt as security measure

• Expecting complete privacy protection

• Not implementing additional safeguards

FAQ

Q: Does the Crawl-delay directive work with all search engines in 2026?

A: No, Crawl-delay support varies significantly between search engines:

  • Google: Completely ignores Crawl-delay; use Search Console instead
  • Bing: Respects Crawl-delay values
  • Yahoo: Limited support
  • Other engines: Variable support

For Google, which handles the majority of searches, configure crawl rate through Google Search Console rather than relying on the robots.txt Crawl-delay directive. This is why it's important to understand that different search engines implement the robots.txt protocol differently.

Q: Should I use robots.txt or the noindex meta tag to prevent pages from being indexed?

A: Use different methods for different purposes:

Robots.txt:

  • Blocks crawling of entire sections
  • Prevents discovery of URLs
  • Good for blocking private areas
  • Won't prevent indexing if linked elsewhere

Noindex Meta Tag:

  • Allows crawling but prevents indexing
  • Useful for pages you want accessible but not searchable
  • More reliable for preventing indexation
  • Must be on each individual page

For maximum control, use robots.txt to prevent crawling and noindex for pages that might be discovered through other means.

About

SEO Team
This robots.txt generator was created
This calculator was created by our Text & SEO Tools Team , may make errors. Consider checking important information. Updated: April 2026.