NinjaFunction (Ninja Function) logo

robots.txt Generator

Create and test a robots.txt file for your website, with ready-made setups, AI crawler blocking and sitemap lines. Free.


Rules

Let all crawlers visit the whole site.

More options

Your robots.txt

User-agent: *
Allow: /

Sitemap: https://www.example.com/sitemap.xml
  • ℹ Remember that robots.txt is a request, not a lock. Bad crawlers can ignore it, so do not use it to hide private pages.

Test an address

✔ Allowed by the rule “Allow: /” in the * group

Save the file as robots.txt and upload it to the top folder of your site, so it opens at yoursite.com/robots.txt. Nothing you type here is sent anywhere.

About This Tool

NinjaFunction's robots.txt Generator builds a robots.txt file for your website. Start from a ready-made setup such as WordPress or an online shop, add rules for any crawler, block well-known AI crawlers with one click, and add your sitemap address. A built-in tester checks any address against your rules the way Google does, using the longest matching rule. Copy the result or download robots.txt. Nothing is sent anywhere.

🔑 How to Use

  1. Pick a ready-made setup that is close to your site, such as WordPress or an online shop.
  2. Edit the rules. Add the folders you want crawlers to skip, and any exceptions.
  3. Add your sitemap address so crawlers find all your pages.
  4. Test a few addresses in the test box to see whether they are allowed or blocked.
  5. Copy or download the file and upload it to the top folder of your site.

💡 Pro Tips

  • ✔ Never block your CSS and JavaScript files. Google needs them to see your pages the way visitors do.
  • ✔ Test the home page first. A single wrong Disallow: / can block your whole site.
  • ✔ Check it after you publish. Open yoursite.com/robots.txt in your browser to make sure it is there.
  • ✔ Need a sitemap to list? Use the Sitemap.xml Generator.

The Lines in a robots.txt File

LineWhat it doesExample
User-agentNames the crawler the rules are for. A star means all of them.User-agent: *
DisallowAsks the crawler not to visit this path.Disallow: /admin/
AllowMakes an exception inside a blocked path.Allow: /admin/help/
SitemapGives the address of your sitemap.Sitemap: https://example.com/sitemap.xml
Crawl-delayAsks the crawler to wait between requests. Google ignores it.Crawl-delay: 10

Common robots.txt Examples

GoalRule
Allow every crawler to read everythingUser-agent: * / Disallow:
Block the admin folderDisallow: /admin/
Block one crawlerUser-agent: BadBot / Disallow: /
Point to your sitemapSitemap: https://example.com/sitemap.xml

Mistakes to Avoid

  • Blocking the whole site by accident with Disallow: / under User-agent: *.
  • Blocking CSS and JavaScript files, which stops search engines from seeing the page correctly.
  • Using robots.txt to hide private pages. The file is public, so it can point people to the page. Use a login or a noindex tag.
  • Putting the file in a sub-folder. It must be at the root, such as example.com/robots.txt.

Test Before You Publish

A single wrong line can keep a good page out of search results. Use the built-in tester to check the pages you care about, including your home page and your most important category and product pages, then upload the file to the root of your site and open yoursite.com/robots.txt to confirm it shows.

Frequently Asked Questions

What is a robots.txt file?

It is a small text file at the top of your website that tells search engines and other crawlers which parts of the site they may visit. It lives at yoursite.com/robots.txt.

Does robots.txt hide pages from Google?

Not reliably. It asks well-behaved crawlers not to visit a page, but a blocked page can still show up in search if other sites link to it. To keep a page out of search, use a noindex tag on the page, and do not block it in robots.txt, or Google will never see the tag.

Is robots.txt a way to keep things private?

No. It is a polite request that bad crawlers ignore, and anyone can read the file. Never list private folders in it. Protect private pages with a login instead.

How do I block AI crawlers?

Add a group for each AI crawler with Disallow: /. The Block AI crawlers button adds the well-known ones, such as GPTBot, ClaudeBot, Google-Extended and CCBot. This only works for crawlers that choose to follow the rules.

Where do I put the file?

Upload it to the top folder of your site so it opens at yoursite.com/robots.txt. A robots.txt in a subfolder is ignored. Each subdomain needs its own file.

What do the star and the dollar sign mean?

A star (*) matches any run of characters, so /*.pdf matches every PDF address. A dollar sign ($) means the address must end there, so /*.pdf$ matches only addresses that end in .pdf.

What happens when two rules match?

Google uses the longest matching rule, so a more specific rule wins. If an Allow and a Disallow are equally long, Allow wins. The test box on this page follows the same rules, so you can check an address before you publish.

Should I add my sitemap?

Yes. A Sitemap line helps crawlers find all your pages. Use the full address that starts with https://. You can list more than one.

Always FreeAll tools are 100% free to use.
No Sign UpNo registration or login required.
Blazing FastInstant results, always.