Skip to content
WordPress hosting special: up to 25% off From $7.96/mo →
eleven2 blog

Web Hosting Guides

How to make a robots.txt?

When optimizing your web site most webmasters don’t consider using the robots.txt file.This is a very important file for your site. It let the spiders and crawlers know what they can and can not index. This is helpful in keeping them out of folders that you do not want index like the admin or stats folder.

Here is a list of variables that you can include in a robot.txt file and there meaning:

1) User-agent: In this field you can specify a specific robot to describe access policy

for or a “*” for all robots more explained in example.

2) Disallow: In the field you specify the files and folders not to include in the crawl.

3) The # is to represent comments

Here are some examples of a robots.txt file

User-agent: *
Disallow:
The above would let all spiders index all content.

Here another example

User-agent: *
Disallow: /cgi-bin/
The above would block all spiders from indexing the cgi-bin directory.

User-agent: googlebot
Disallow:

User-agent: *
Disallow: /admin.php
Disallow: /cgi-bin/
Disallow: /admin/
Disallow: /stats/
In the above example googlebot can index everything while all other spiders can not index admin.php , cgi-bin, admin, and stats directory. Notice that you can block single files like admin.php.

Join the conversation

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Free migration · 60-day money-back

Ready to make the move?

Fast NVMe hosting, a 99.9% uptime guarantee, and real humans on call 24/7/365. We’ll move your site over for free.