Menu

Robots.txt Generator

Purpose: Create a valid robots.txt to control how search engines crawl your site.


  

Robots.txt Generator: How It Works

robots.txt controls what crawlers are allowed to request. It does not control what appears in search results — a distinction that causes more accidental de-indexing and more unwanted indexing than any other file on a website.

Crawling is not indexing

This is the central point. Disallow prevents a crawler from fetching a URL. It does not remove that URL from the index, and a disallowed page linked from elsewhere can still appear in results — typically with no description, marked as blocked.

Worse, because the crawler cannot fetch the page, it cannot see a noindex tag on it. Blocking a page you want removed guarantees the removal instruction is never read.

GoalCorrect method
Keep a page out of search resultsnoindex meta tag or header — and allow crawling
Save crawl budget on low-value URLsDisallow in robots.txt
Protect private contentAuthentication — never robots.txt
Handle duplicate URLsCanonical tags

robots.txt is a public file at a predictable address. Listing a sensitive directory in it advertises exactly what you were hoping to hide.

Syntax

User-agent: *
Disallow: /admin/
Disallow: /cart
Allow: /admin/public-guide.html

User-agent: Googlebot
Allow: /

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

The catastrophic line

User-agent: *
Disallow: /

This blocks the entire site. It is the standard configuration for a staging environment, and pushing it to production is one of the most common ways a site disappears from search. If organic traffic drops sharply and suddenly, check this file before anything else.

What to actually block

Do not block CSS or JavaScript. Google renders pages to evaluate them, and blocking the resources needed to render produces a page it judges broken.

Crawl-delay and other directives

Crawl-delay is not supported by Google, though Bing and others honour it. Google's crawl rate is managed through Search Console and adjusts automatically to your server's response times. Noindex in robots.txt was never officially supported and stopped working entirely in 2019 — anyone still using it is not blocking anything.

After you generate it

Place the file at the root, confirm it returns a 200 status, and test specific URLs with Search Console's robots.txt report. A 500 error on robots.txt causes Google to pause crawling the site entirely, which makes the file's availability as important as its contents.

Frequently Asked Questions

Will robots.txt remove a page from Google?
No. It stops the page being crawled, but a blocked URL linked from elsewhere can still appear in results without a description. To remove a page, allow crawling and use a noindex tag — otherwise the instruction can never be read.
Can I hide private files with robots.txt?
No, and attempting to is counterproductive. The file is public, so listing a directory tells anyone reading it exactly where to look. Private content needs authentication.
Should I block CSS and JavaScript?
No. Google renders pages to assess them, and blocking rendering resources makes your page look broken to the evaluator. This was once common advice and is now clearly harmful.
Does Google respect crawl-delay?
No. Bing and some others do. Google adjusts its crawl rate automatically based on your server's responsiveness, and the rate can be influenced through Search Console.
What happens if robots.txt returns an error?
A 404 is treated as permission to crawl everything. A 500 or other server error causes Google to pause crawling the site rather than risk violating rules it cannot read — so an unreachable robots.txt is worse than a missing one.
Do I need a robots.txt file at all?
Not strictly — a missing file means everything may be crawled, which is fine for many small sites. It is still worth having, if only to declare your sitemap location and block genuinely wasteful URL patterns.

Related SEO Tools

Browse all SEO tools →