Skip to main content
toolsxulo

Robots.txt Generator

Build a robots.txt with User-agent groups, Disallow and Allow paths, and a Sitemap line. Start from a preset, copy or download the file, and host it at your site root.

Quick presets

Rule group 1

robots.txt
User-agent: *
Disallow:

How it works

A robots.txt file lives at the root of your site, at a URL like https://www.example.com/robots.txt. It tells crawlers which paths they may request and which they should not. This tool builds that text from the groups you fill in, so you can copy it or download a file and put it at your domain root.

The file does not remove a page from search results. A path marked Disallow can still appear in results if other sites link to it, usually without a description. To ask that a page not be shown in results, add a noindex tag on the page itself and leave that page crawlable, otherwise the crawler will not see the tag. You can also password-protect the page. Not every crawler obeys robots.txt, and anyone can open the file at that URL and read it, so do not use it to hide secret content.

Each group starts with a User-agent: * applies to all crawlers, or you can name a specific crawler such as Googlebot. Then come Disallow and Allow paths, one per line, each starting with /. If a group has no paths, the tool still writes a bare Disallow: line. A rule with no path does not block anything. If you enter a Sitemap URL, it is appended at the end as a full URL.

Three quick presets: "Block everything" writes Disallow: /, "Allow everything" writes Allow: /, and "Block a folder" writes Disallow: /private/. To allow one file inside a blocked folder, add an Allow line for that exact path. Google uses the more specific rule (the longer path); if two rules match equally, it uses the less restrictive one, which is Allow. Other crawlers may apply this differently. The tool only generates the text. It does not upload the file to your site.

Read the full guide

How to use it

  1. Start from a quick preset, or build a group from scratch. When the page loads there is already a group with User-agent * and no paths, and the output is User-agent: * followed by a bare Disallow: line.
  2. Set the User-agent, then list Disallow and Allow paths, one per line, each starting with /.
  3. If you want different rules for each bot, press "Add rule group". In Google's documentation, a crawler uses the most specific group that matches its name, and the * group otherwise.
  4. If you have a sitemap, paste its full URL in the Sitemap field.
  5. Copy the text, or press "Download robots.txt".
  6. Host the file at your domain root, named exactly robots.txt, for example https://www.yoursite.com/robots.txt. Check that the URL opens in a browser. In Search Console you can test a specific URL with URL Inspection, and see the file Google fetched in the robots.txt report under settings.

Examples

A shop site. User-agent *, Disallow: /admin/ and /cart/, and Sitemap: https://www.example.com/sitemap.xmlUser-agent: * Disallow: /admin/ Disallow: /cart/ Sitemap: https://www.example.com/sitemap.xml These lines ask crawlers not to request the admin area or the cart, and point them to the sitemap. All other paths stay allowed.
User-agent *, Disallow: /private/, Allow: /private/price-list.pdfUser-agent: * Disallow: /private/ Allow: /private/price-list.pdf The /private/ folder is blocked, but the price-list.pdf file inside it is allowed. The tool writes Disallow lines first, then Allow.
Blogger. User-agent *, Disallow: /search, and Sitemap: https://myblog.blogspot.com/sitemap.xmlUser-agent: * Disallow: /search Sitemap: https://myblog.blogspot.com/sitemap.xml This is a common starting point that blocks Blogger's internal search pages. A custom file in Blogger replaces the default entirely, so first open https://myblog.blogspot.com/robots.txt and keep any rules you still need. Do not write Disallow: /, which would block the whole blog.

Frequently asked

Does robots.txt remove a page from search results?
No. It only asks crawlers not to request the path. The page can still appear in results if other sites link to it, usually without a description. To ask that it not be shown, put a noindex tag on the page and leave the page crawlable, or password-protect it.
Where does the robots.txt file have to live?
At the domain root, at an exact URL such as https://www.example.com/robots.txt, with no login, and with that filename only. A file at a path like /en/robots.txt is not the site's robots.txt.
How do I add a robots.txt file in Blogger?
In the blog settings, under Crawlers and indexing, turn on Enable custom robots.txt. The text you paste replaces Blogger's default file, so first open the blog's current /robots.txt and keep any rules you still need, such as blocking /search and a Sitemap line.
What does a WordPress robots.txt look like?
WordPress core's default blocks /wp-admin/ and allows /wp-admin/admin-ajax.php, and it often adds a Sitemap line. Entered in this tool, the output is: User-agent: * Disallow: /wp-admin/ Allow: /wp-admin/admin-ajax.php Sitemap: https://www.example.com/wp-sitemap.xml WordPress can serve a virtual robots.txt; a physical file at the site root usually replaces it. If a plugin also manages the file, check that the two are not overriding each other.
Is a robots.txt file private?
No. Anyone can open it at your site's /robots.txt URL. Do not put passwords in it, and do not rely on it to hide an admin area that is still publicly reachable. Use authentication for private content.
How do I allow a file inside a folder I blocked?
In the same group, add an Allow line for the file's exact path, as in example 2. Google uses the more specific rule; if two rules match equally, Allow wins. Other crawlers may behave differently.

Related tools