About the Robots.txt Generator
A robots.txt file tells search engine crawlers which parts of a site they should not request, and one wrong line can hide an entire site from search results. This robots.txt generator builds the file from rules you choose, with per-crawler sections, a sitemap line and presets for common platforms, and it checks for dangerous mistakes such as disallowing everything. Remember that robots.txt does not keep pages private and does not remove indexed pages; use a noindex tag or password protection for that. To list your pages for crawlers, use the XML Sitemap Generator, and for server rules, the .htaccess Generator.
Those mistakes are specific and surprisingly common. Writing Disallow: / shuts crawlers out of every page, and a single typing slip can produce exactly that line. Matching works on the start of a path, which means a rule for /admin catches /administrator-notes too. A blank line inside a group ends that group early. Finally, crawlers fetch the file from one location only, the top level of the domain, so copies elsewhere are ignored.
Above all, understand what robots.txt does not do. Polite bots will skip the blocked addresses, yet those addresses can still be listed in results when other sites link to them, and nothing about the file is secret. A blocked page can still be indexed, usually as a bare address with no description. Removal from results calls for a crawlable page carrying noindex; real privacy calls for a password.
How to use the Robots.txt Generator
- Start from a preset or a blank fileChoose a fully open setup, a WordPress-friendly one, a lock-down for test servers, or nothing at all.
- Add rules for each crawlerName the bot, then list folders it may or may not enter.
- Add your sitemap addressPointing crawlers to your sitemap speeds up discovery of new pages.
- Copy and uploadSave it as robots.txt in the root folder of your domain.
Robots.txt Generator features
- Rule groups tailored to individual bots
- Starting templates for common setups
- Any number of sitemap references
- Crawl-delay setting with honest notes on its limited support
- Alarm when one line would hide everything
- Plain guidance on blocking versus removal from results
- Copy or download the finished file
Common uses
- Setting crawl rules before a new site launches
- Steering bots away from dashboards and on-site search results
- Keeping a test copy of a site out of crawlers' reach
- Announcing the location of one or more sitemaps
- Giving one search engine access that others do not get
Robots.txt in practice: a WordPress shop's file, keeping CSS and scripts crawlable, filter pages, AI crawlers, testing in Search Console and staging sites
The robots.txt file tells crawlers which parts of a site they may visit. It is simple to write and easy to get wrong, since a single misplaced line can block an entire site from search. This guide writes a file for a WordPress shop and covers why CSS and scripts must stay crawlable, filter pages on large shops, AI crawlers, testing, how quickly changes apply and why staging sites need more than robots rules.
A worked example: a WordPress shop
A WordPress shop uses this file:
User-agent: *Disallow: /wp-admin/Allow: /wp-admin/admin-ajax.phpDisallow: /cart/Disallow: /checkout/Disallow: /?s=Sitemap: https://shop.example.pk/sitemap_index.xml
Admin pages, cart, checkout and internal search results are kept out of crawling, while the AJAX endpoint that front-end features rely on stays open. The Sitemap line points crawlers to the list of pages that should be crawled.
Keep CSS and scripts crawlable
Search engines render pages much as browsers do, so they need access to stylesheets, scripts and images. Blocking folders that contain these files, which older guides sometimes recommended, can make pages look broken to search engines and harm how they are understood. Check that theme and plugin asset folders are not disallowed.
Filter pages on large shops
Shops with filters for size, colour, price and brand can generate millions of combinations of addresses. Crawlers can waste their time on these instead of important pages. Disallowing filter parameters that create endless combinations, while keeping main category pages open, focuses crawling where it matters.
AI crawlers
Several AI companies run crawlers that collect content for training models, such as GPTBot, and Google offers a Google-Extended token to control whether content is used for its AI models without affecting search. Site owners can allow or disallow these separately. Decide based on your own view, and remember that robots rules are voluntary for crawlers.
Testing changes
Search Console's robots.txt report shows the version Google last fetched and any errors in it. Before publishing changes, check important addresses against the new rules, especially the home page and key categories, to make sure nothing valuable is blocked by a broad pattern.
How quickly changes apply
Search engines cache robots.txt for a period, often up to a day, so changes do not take effect instantly. After unblocking important pages, allow time for crawlers to fetch the updated file, then request recrawling of key pages if needed.
Staging sites need more
Disallowing everything on a staging site does not keep it out of search results if pages are linked from elsewhere, and it leaves the content public. Password protection keeps both crawlers and visitors out. When copying a staging site to live, make sure its blocking rules are not copied too.
Blocking is not hiding
Robots rules are public, and anyone can read the file. Listing sensitive paths in it can point curious people straight to them. Protect private areas with authentication, not with robots rules, and keep the file focused on guiding legitimate crawlers.
Common mistakes
- Copying a staging site's disallow-all file to the live site.
- Blocking CSS and JavaScript folders.
- Using robots.txt to hide private pages.
- Forgetting the Sitemap line.
Related tools
To build the sitemap the file points to, use XML Sitemap Generator. To password-protect staging sites, try Htpasswd Generator, and for server rules, .htaccess Generator.
One file per host
Each host needs its own robots.txt: rules on example.com do not apply to shop.example.com or blog.example.com. Subdomains used for images, files or staging need their own files if crawling there should be controlled.
Format and size
The file must be plain text, ideally UTF-8, at the root of the host. Google reads up to 500 KiB of it and ignores anything beyond. Large files usually mean too many individual rules; patterns covering whole folders or parameters are simpler and safer.
Crawl-delay
Some crawlers, such as Bing's, respect a Crawl-delay line that spaces out their requests, while Google ignores it and adjusts its crawling rate automatically based on how the server responds. If crawling strains a server, improving performance or caching is more effective than relying on crawl-delay.
Comments for future editors
Lines starting with a hash sign are comments. A short note explaining why each rule exists, such as blocking filter parameters to save crawl budget, prevents a future editor from removing an important rule or keeping an obsolete one.
Keeping images out of image search
To stop images appearing in Google Images while pages remain in web search, rules can target Google's image crawler specifically. This suits sites whose images are licensed or private, although images embedded elsewhere may still be found through other pages.
Check after updates
Plugins, themes and hosting tools sometimes rewrite robots.txt during updates or migrations. Viewing the live file after each major change, and comparing it with the version you intended, catches accidental blocks before search engines act on them.
Privacy
The file is generated in your browser. Nothing is sent anywhere or stored.
Frequently asked questions
Will robots.txt remove a page from search results?
No, and this confusion is widespread. Blocking only stops visits by crawlers; links from elsewhere can still get the address listed with no snippet. To keep it out, allow crawling and add a noindex tag.
Can robots.txt protect private pages?
Not at all. Being public, it effectively hands visitors a list of the folders you hoped they would ignore. Anything genuinely private must be protected with a login or other authentication.
Where does the file need to be?
In the root of the domain, so that it opens at yourdomain.com/robots.txt. Crawlers only look for it there, and its rules apply only to the exact host and protocol that served it.
Do all crawlers follow robots.txt?
Google, Bing and the other major engines do. Content scrapers and attack bots typically disregard it, since compliance is voluntary. The crawl-delay line in particular is respected by some search engines and ignored by others, including Google.
Does a rule apply to longer paths too?
Yes, because matching is by prefix: Disallow: /admin also covers /administrator and /admin-old. A dollar sign marks the end of a path and an asterisk acts as a wildcard, and the major crawlers support both.
What happens if my site has no robots.txt?
Crawlers assume everything is allowed, which is fine for most normal websites. A missing file is not an error and does not harm your rankings.