ServerAvatar Logo

Free Robots.txt Generator

Create SEO-friendly robots.txt files in seconds. Control how search engines crawl your website with our easy-to-use generator.

Generate Your Robots.txt File

Configure your robots.txt file settings below. The generator will create a properly formatted file that follows SEO best practices.

Custom User-Agent Rules

Add specific rules for different crawlers.

No custom rules added yet.

Generated Robots.txt

✅ Copied to clipboard!

Complete Robots.txt Syntax Guide

Understanding robots.txt syntax is crucial for proper SEO implementation. Here's everything you need to know:

User-agent Directive

User-agent: * User-agent: Googlebot User-agent: Bingbot
Specifies which crawler the rules apply to. Use * for all crawlers or specific bot names.

Disallow Directive

Disallow: /admin/ Disallow: /private/ Disallow: *.pdf
Tells crawlers which pages or directories NOT to crawl. Essential for protecting sensitive areas.

Allow Directive

Allow: / Allow: /public/ Allow: /blog/
Explicitly allows crawling of specific paths. Useful for overriding broader disallow rules.

Sitemap
Directive

Sitemap: https://example.com/sitemap.xml
Sitemap: https://example.com/news-sitemap.xml
Points crawlers to your XML sitemap for better discovery and indexing of your content.

Crawl-delay Directive

Crawl-delay: 1
Crawl-delay: 10
Sets the minimum delay (in seconds) between requests to prevent server overload.

Wildcards & Patterns

Disallow: *.pdf$ Disallow: /*? Disallow: /search*
Use wildcards (*) and end anchors ($) for advanced pattern matching and URL filtering.

Robots.txt Examples for Different Website Types

Ready-to-use robots.txt examples tailored for specific website types and platforms:

E-commerce Store

User-agent: *
Allow: /
Disallow: /admin/
Disallow: /cart/
Disallow: /checkout/
Disallow: /customer/
Disallow: /search?
Disallow: /*?sort=
Disallow: /*?filter=

Sitemap: https://yourstore.com/sitemap.xml
Perfect for: WooCommerce, Shopify, Magento stores

WordPress Blog

User-agent: *
Allow: /
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /wp-content/plugins/
Disallow: /wp-content/themes/
Allow: /wp-content/uploads/
Disallow: /*?s=
Disallow: /feed/
Disallow: /comments/

Sitemap: https://yourblog.com/sitemap.xml
Perfect for: WordPress blogs, news sites, content websites

Corporate Website

User-agent: *
Allow: /
Disallow: /admin/
Disallow: /private/
Disallow: /internal/
Disallow: /staff/
Disallow: /temp/
Disallow: *.pdf$
Disallow: *.doc$

Sitemap: https://company.com/sitemap.xml
Perfect for: Business websites, corporate pages, service providers

Documentation Site

User-agent: *
Allow: /
Disallow: /admin/
Disallow: /api/
Disallow: /search?
Allow: /docs/
Allow: /guides/
Allow: /tutorials/

Sitemap: https://docs.example.com/sitemap.xml
Perfect for: API docs, knowledge bases, help centers

Landing Pages

User-agent: *
Allow: /
Disallow: /admin/
Disallow: /thank-you/
Disallow: /confirmation/
Disallow: /download/
Disallow: /*?utm_

Sitemap: https://landing.com/sitemap.xml
Perfect for: Marketing sites, lead generation, campaign pages

Block All Crawlers

User-agent: *
Disallow: /

# Use this for:
# - Development sites
# - Private websites
# - Under construction pages
Perfect for: Staging sites, private projects, development environments

Popular Search Engine User-Agents

Target specific search engines with their exact user-agent strings:
Search EngineUser-AgentPurposeExample Usage
Google GoogleGooglebotWeb crawlingMost important for SEO
Bing BingbingbotWeb crawlingSecond largest search engine
Yahoo YahooSlurpWeb crawlingYahoo search results
🦆 DuckDuckGoDuckDuckBotPrivacy-focused searchGrowing alternative search
🐦 TwitterTwitterbotLink preview generationSocial media optimization
📘 FacebookfacebookexternalhitLink preview crawlingSocial sharing optimization
💼 LinkedInLinkedInBotProfessional contentBusiness networking
📱 Mobile GoogleGooglebot-MobileMobile-first indexingMobile SEO optimization

Robots.txt SEO Best Practices

✅ DO These Things

  • Place in root directory - Must be at yoursite.com/robots.txt
  • Use lowercase filenames - Always "robots.txt", never "Robots.txt"
  • Include your sitemap - Help search engines find all your pages
  • Block admin areas - Protect sensitive directories like /wp-admin/
  • Test your robots.txt - Use Google Search Console's robots.txt tester
  • Keep it simple - Clear, concise rules work best
  • Update regularly - Review when you add new sections to your site
  • Allow important content - Ensure valuable pages are crawlable

❌ DON'T Do These Things

  • Don't block CSS/JS files - Google needs these for proper rendering
  • Don't use it for security - Robots.txt is publicly accessible
  • Don't block images unnecessarily - Can hurt image SEO
  • Don't create complex patterns - Keep rules simple and clear
  • Don't block entire site - Unless it's a staging/dev environment
  • Don't forget mobile crawlers - Consider Googlebot-Mobile
  • Don't use relative URLs - Always use full URLs for sitemaps
  • Don't ignore case sensitivity - Robots.txt rules are case-sensitive

Common Robots.txt Mistakes That Hurt SEO

Blocking Important Resources

Wrong:

Disallow: *.css Disallow: *.js

Why it's bad: Google needs CSS and JavaScript to properly render and understand your pages.

Impact: Poor mobile-friendly test results, incorrect page rendering in search results.

Incorrect Sitemap URL

Wrong:

Sitemap: /sitemap.xml

Right:

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

Why it matters: Relative URLs in sitemap directives may not work properly.

Blocking Search Result Pages

Good practice:

Disallow: /*?s= Disallow: /search?

Why block these: Search result pages create duplicate content and waste crawl budget.

Benefit: Focus crawler attention on your important content pages.

Missing Crawl-Delay for Slow Servers

When to use:

User-agent: * Crawl-delay: 1

Use cases: Slow servers, shared hosting, high-traffic sites.

Warning: Google ignores crawl-delay, but other search engines respect it.

How to Test Your Robots.txt File

1

Upload to Root Directory

Place your robots.txt file at https://yoursite.com/robots.txt

💡 Tip: Make sure it's accessible and returns a 200 status code
2

Test in Google Search Console

Use the robots.txt Tester tool to check for syntax errors and test specific URLs

🔗 Path: Search Console → Crawl → robots.txt Tester
3

Validate Syntax

Check for common syntax errors like missing colons, incorrect spacing, or invalid directives

⚠️ Remember: Robots.txt is case-sensitive and space-sensitive
4

Monitor Crawl Errors

Watch for crawl errors in Search Console that might indicate robots.txt issues

📊 Check: Coverage report for blocked pages and crawl stats

Frequently Asked Questions

A robots.txt file is a text file that tells search engine crawlers which pages or sections of your website they should or shouldn't crawl. It's placed in the root directory of your website and follows the Robots Exclusion Protocol.

The robots.txt file must be placed in the root directory of your website. For example, if your website is example.com, the robots.txt file should be accessible at example.com/robots.txt.

While not mandatory, a robots.txt file is highly recommended for SEO. It helps search engines understand your site structure and prevents them from crawling unnecessary pages, which can improve your crawl budget efficiency.

Crawl delay is the number of seconds a crawler should wait between requests to your server. This helps prevent overwhelming your server with too many requests at once. Most modern search engines ignore this directive, but some crawlers still respect it.

No, robots.txt is not a security measure. It's a polite request to search engines, and compliant crawlers will respect it. However, malicious crawlers may ignore it. For true access control, use password protection or server-level restrictions.

Yes, including your sitemap URL in robots.txt is a good practice. It helps search engines discover your sitemap and understand your site structure better. You can include multiple sitemap URLs if needed.

Update your robots.txt file whenever you make significant changes to your website structure, add new sections you want to block, or when you launch new features that affect crawling behavior.

Ready to Transform Your Hosting?

Join 1,000+ developers who’ve simplified server management with ServerAvatar. Get started for free and deploy your first server and application in minutes.
  • No Credit Card Required
  • Free $10 Server Credits
  • Deploy in next 10 minutes!