SEOLyzerPro
Use 47 free online tools: meta tag and robots.txt generators, image and text tools, JSON converters, calculators and unit converters. No signup needed
Robots.txt Generator
Tell search engine bots what they may crawl
Robots.txt Generator
What this tool does
The Robots.txt Generator builds a robots.txt file, a small text file that tells search engine crawlers which parts of your website they may or may not visit. You choose your rules, add your sitemap address, and copy the finished file. It helps you avoid syntax errors that can accidentally block important pages.
How to use it
- Decide whether all crawlers may access your site, or whether specific crawlers need their own rules.
- Add the folders or pages you do not want crawled, such as admin areas or internal search results.
- Add the full address of your XML sitemap.
- Generate the file and copy the text.
- Save it as a plain text file named robots.txt and upload it to the root of your site, for example https://www.example.com/robots.txt.
What the file looks like
User-agent: *
Disallow: /admin/
Allow: /admin/help/
Sitemap: https://www.example.com/sitemap.xml
[Replace this with a sample copied from your own tool.]
What each line means
- User-agent names the crawler the rules apply to. An asterisk means all crawlers.
- Disallow lists a path the crawler should not request.
- Allow makes an exception inside a blocked path. Google supports it and uses the most specific matching rule.
- Sitemap gives the address of your XML sitemap so crawlers can find your pages more easily.
- Crawl-delay asks a crawler to wait between requests. Google ignores this line, though some other search engines read it.
Paths are case-sensitive, and Google also understands the wildcard * and the end-of-URL marker $ in patterns.
A common WordPress example
Many WordPress sites block the admin area but allow the admin-ajax file, which some themes and plugins need:
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Sitemap: https://www.example.com/sitemap.xml
Important things to understand
Robots.txt is not security. The file is public, and anyone can read it. Do not list private folders as a way to hide them, because that actually points people to them. Protect private content with passwords or server permissions.
Blocking is not the same as removing from search. If a blocked page is linked from other places, search engines can still list its address without a description. To keep a page out of search results, use a noindex meta tag or header, and let the page remain crawlable so the instruction can be seen.
Do not block resources your pages need. Search engines render pages much like a browser, so blocking CSS, JavaScript or image folders can stop them from understanding your layout.
Each host has its own file. A robots.txt file applies only to the exact host and protocol where it sits. A subdomain needs its own file.
Mistakes that cost traffic
- A single line “Disallow: /” under “User-agent: *” blocks your entire site. This is sometimes left over from a development site.
- Using the wrong file name, such as Robots.txt, or saving it with formatting from a word processor instead of plain text.
- Placing the file in a subfolder rather than the root.
- Blocking pages that you also want to rank.
- Forgetting to update the sitemap line after moving to a new address or HTTPS.
Testing your file
After uploading, open your robots.txt address in a browser and check that the text appears exactly as you expect. Then use the robots.txt report in Google Search Console to confirm Google can fetch it and see whether any rules cause problems. Test important URLs to make sure they are not blocked by mistake. Google reads only a limited file size, around 500 KiB, which is far more than most sites need.
Limits of this tool
The generator creates the text of the file, but it does not upload it, check your live site, or guarantee that every crawler will obey the rules. Reputable search engines follow robots.txt, but badly behaved bots can ignore it. Always test changes carefully, because a small mistake can affect how your whole site is crawled.
Frequently asked questions
Do I need a robots.txt file?
It is not required. Without one, crawlers assume they may visit everything. A file helps when you want to guide them or point to your sitemap.
Can robots.txt improve my rankings?
Not directly. It helps crawlers spend time on useful pages, which can support good site management.
Should I block my login page?
You may, but it does not secure the page. Keep strong passwords and protection in place.
Where do I upload it?
In the top-level folder of your site, so it loads at your domain followed by /robots.txt.
Related tools
Meta Tag Generator, Meta Tags Analyzer, HTTP Status Code Checker, Redirect Checker, htaccess Redirect Generator and FAQ Schema Generator.