Skip to content
GENERATORS

Robots.txt Generator Online

Generate a basic robots.txt file.

  • Free
  • No signup
  • Runs in your browser

This tool runs in your browser. The text you enter is processed on your device and is not sent to NHP Learning.

Robots.txt Generator

About Robots.txt Generator

The robots.txt file sits at the root of your website and tells search engine crawlers which paths they may visit. A correct file keeps crawlers out of admin and search pages and points them to your XML sitemap.

Enter your rules one per line, such as Disallow: /wp-admin/, and add your sitemap URL on its own line. The tool writes a file with a User-agent: * group, your rules in order and the Sitemap line. With no rules it writes Allow: / so the whole site can be crawled.

How to use Robots.txt Generator

  1. Type your Allow or Disallow rules and your sitemap URL, one per line.
  2. Click Run Tool to generate the file.
  3. Save it as robots.txt in your site root, then test it in Google Search Console.

Example

Input

Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
https://nhplearning.com/sitemap_index.xml

Output

User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php

Sitemap: https://nhplearning.com/sitemap_index.xml

Common uses

  • Creating a first robots.txt for a new site.
  • Blocking WordPress admin pages while still allowing admin-ajax.php.
  • Adding your sitemap location so crawlers find it quickly.

Privacy and safety

This tool runs in your browser. The text you enter is processed on your device and is not sent to NHP Learning.

Frequently asked questions

Does Disallow remove pages from Google?

No. It stops crawling but a blocked URL can still be indexed if other pages link to it. To keep a page out of search results, use a noindex meta tag and let it be crawled.

Where must the file be placed?

At the root of the domain, for example https://example.com/robots.txt. A file in a subfolder is ignored.

Can I add rules for specific bots?

This generator writes one group for all crawlers. Add extra User-agent groups by hand in the finished file.

Learn to build this yourself

Free tutorials and courses on NHP Learning cover PHP, JavaScript, SQL and WordPress, from the basics to real projects.