Robots.txt Generator – Create Robots File

Search Engine Optimization

Robots.txt Generator


Default - All Robots are:  
    
Crawl-Delay:
    
Sitemap: (leave blank if you don't have) 
     
Search Robots: Google
  Google Image
  Google Mobile
  MSN Search
  Yahoo
  Yahoo MM
  Yahoo Blogs
  Ask/Teoma
  GigaBlast
  DMOZ Checker
  Nutch
  Alexa/Wayback
  Baidu
  Naver
  MSN PicSearch
   
Restricted Directories: The path is relative to root and must contain a trailing slash "/"
 
 
 
 
 
 
   



Now, Create 'robots.txt' file at your root directory. Copy above text and paste into the text file.


About Robots.txt Generator

A robots.txt file gives compliant web crawlers instructions about which URL paths they may request from a website. Our free robots.txt generator helps you prepare those instructions in the correct plain-text format and add the location of your XML sitemap. You can review the generated rules before placing the file on your server.

Robots.txt is useful for crawl management, but it must be configured carefully. A rule that blocks an important folder can prevent search engines from fetching its pages and resources. It is not a security system, and it is not the correct method for keeping confidential information private.

What Is a Robots.txt File?

Robots.txt is a publicly accessible text file used by the Robots Exclusion Protocol. It groups crawling rules by user-agent and normally contains directives such as Allow and Disallow. Search-engine crawlers that support the protocol retrieve the file before requesting URLs from the website and apply the rules relevant to their user-agent.

The file must be available at the root of the exact host and protocol it controls. For example:

https://www.example.com/robots.txt

A file located at https://www.example.com/folder/robots.txt does not control the whole website. Rules for a subdomain such as shop.example.com must be served from that subdomain’s own root. HTTP and HTTPS are also separate origins, so the preferred live website should serve its robots.txt file consistently.

What Robots.txt Can and Cannot Do

Robots.txt Can Manage Crawling

You can use robots.txt to ask compliant crawlers not to request selected folders, files or URL patterns. This may help reduce unnecessary crawling of low-value areas such as internal search results, filtered URL combinations or administrative paths. It can also point crawlers to one or more XML sitemaps.

Robots.txt Does Not Guarantee Noindex

A disallowed URL may still be discovered through links or other sources and can sometimes appear in search results without a descriptive snippet. If a public HTML page must not appear in Google, allow Google to crawl it and use a supported noindex meta tag or HTTP header. If robots.txt blocks the page, the crawler may never see its noindex instruction.

Robots.txt Does Not Protect Private Data

The file is public, its rules are voluntary, and malicious bots may ignore them. Never use it to protect passwords, customer records, private documents or sensitive directories. Use authentication, authorization and appropriate server security. Publishing a sensitive path in robots.txt can even draw attention to its location.

Robots.txt Does Not Improve Rankings Directly

A correct file can support efficient crawling, but creating one does not automatically increase rankings, speed up the website or guarantee indexing. Search visibility also depends on accessible pages, useful original content, consistent canonical signals, internal links and many other factors.

How to Use the Robots.txt Generator

  1. Select the default crawling preference offered by the generator.
  2. Choose the search-engine robots or user-agents to which specific rules should apply.
  3. Add any folders or paths that should not be crawled.
  4. Add the full HTTPS URL of your sitemap or sitemap index.
  5. Generate the robots.txt content.
  6. Read every line and confirm that no important public page, CSS file, JavaScript file or image resource is blocked.
  7. Save the result as a plain-text file named exactly robots.txt.
  8. Upload it to the website’s document root and test the public URL.

Do not upload a generated file without reviewing it. The generator creates directives from the options you provide; it cannot know which private-looking folders are necessary for rendering or which public pages are important to your business.

Common Robots.txt Directives

User-agent

User-agent identifies the crawler to which the following group of rules applies. An asterisk represents all crawlers that do not have a more specific matching group:

User-agent: *

You can create separate groups for recognized crawler product tokens when different crawl rules are genuinely required. Keep the configuration simple unless there is a clear reason to separate crawlers.

Disallow

Disallow specifies a path that the matching crawler should not request. Each path normally uses its own line:

User-agent: *
Disallow: /admin/
Disallow: /internal-search/

An empty Disallow: value does not block any path. A value of / blocks crawling of the entire host for that user-agent, so it should never be used accidentally on a public website.

Allow

Allow can permit a more specific path inside a broader disallowed area when supported by the crawler. For example:

User-agent: *
Disallow: /folder/
Allow: /folder/public-page.html

When rules overlap, matching behavior depends on the crawler’s implementation and the specificity of the path. Test important configurations with the documentation and tools provided by the search engine you care about.

Sitemap

The Sitemap field points to a sitemap or sitemap index. Use the complete absolute URL, including protocol and hostname:

Sitemap: https://www.example.com/sitemap.xml

You may list more than one sitemap when necessary. A sitemap helps crawlers discover preferred URLs, but it does not override a robots.txt block and does not guarantee that every listed page will be indexed.

Comments

A hash symbol begins a comment. Comments can explain why a rule exists:

# Block the private administration area
User-agent: *
Disallow: /admin/

Keep comments concise and avoid publishing sensitive operational information.

Example Robots.txt Files

Allow Crawling and Declare a Sitemap

User-agent: *
Disallow:

Sitemap: https://www.example.com/sitemap.xml

Block Selected Administrative Paths

User-agent: *
Disallow: /admin/
Disallow: /internal-search/

Sitemap: https://www.example.com/sitemap.xml

Block the Entire Staging Website

User-agent: *
Disallow: /

A robots.txt block alone is not sufficient protection for a staging environment. The staging site should also require authentication so that unauthorized users and non-compliant crawlers cannot access it.

Common Robots.txt Mistakes

  • Using the wrong filename: the correct name is robots.txt, not robot.txt.
  • Uploading it to a subfolder: the file must be served from the root of the host it controls.
  • Blocking the whole website: an unintended Disallow: / can stop compliant crawlers from accessing all URLs.
  • Treating Disallow as noindex: crawl blocking and indexing control are different.
  • Blocking rendering resources: preventing access to necessary CSS, JavaScript or images may make it harder to understand the page.
  • Listing private locations: robots.txt is public and provides no access control.
  • Using relative sitemap locations: declare the sitemap with a complete absolute URL.
  • Copying another website’s rules: its folders and technical setup may have no relationship to yours.
  • Forgetting separate hosts: subdomains require their own root-level robots.txt files.

When Should You Block a Path?

Consider crawl blocking when a section creates many low-value URL combinations, consumes server resources or provides no useful destination for search users. Examples may include internal search results, temporary generated pages, certain filtered navigation paths or private administration routes.

Do not automatically block duplicate public pages as a substitute for proper canonicalization. Search engines need to crawl a page to read its canonical tag. Depending on the situation, a redirect, canonical element, URL cleanup or removal of unnecessary internal links may be more appropriate.

For a page that should remain accessible to users but stay out of search results, use a supported noindex directive and allow crawling until the search engine processes it. For truly confidential content, require authentication instead of relying on robots directives.

How to Check the Generated File

  1. Open https://yourdomain.com/robots.txt in a browser and confirm it returns HTTP 200 as plain text.
  2. Check that the file belongs to the correct protocol, hostname and subdomain.
  3. Review every Disallow rule for accidental matches.
  4. Open the declared sitemap URL and confirm that it loads successfully.
  5. Inspect important pages in Google Search Console to confirm that crawling is allowed.
  6. Test again after changing folders, routes, domains or site architecture.

If you need to prepare a sitemap, use our XML Sitemap Generator. The sitemap should contain preferred, canonical and indexable URLs rather than every URL the server can produce.

Frequently Asked Questions

Is a robots.txt file required?

No. A small public website that allows all crawling can work without one. A file becomes useful when you need explicit crawl rules or want to advertise sitemap locations. If the file is missing, crawlers may generally assume that no robots.txt restrictions apply.

Can robots.txt remove a page from Google?

It is not a reliable removal method. Blocking the URL prevents crawling, but the URL may still be discovered and indexed from other signals. Use an appropriate noindex, removal process or authentication method according to the situation.

Can robots.txt secure an admin folder?

No. It only requests that compliant crawlers avoid the path. Secure administrative areas with authentication, authorization, updates and proper server configuration.

Should CSS and JavaScript be blocked?

Do not block resources that search engines need to render and understand important public pages. Blocking unnecessary private resources may be acceptable, but test the effect before applying broad folder rules.

Does adding a sitemap guarantee indexing?

No. A sitemap helps discovery and communicates preferred URLs. Search engines still decide which accessible pages to crawl, select as canonical and index.