What is Robots.txt?

In this tutorial, we will study what is robots.txt, what is it used for, how can we create it and how can we test it for its validity or not. So let us start.

What is robots.txt?

The robots.txt file is used to tell the search engine crawlers about which pages or files they can crawl and which they can not request from the web site. This is mainly used to avoid overloading our website with requests. Don’t confuse yourself by assuming it to be a mechanism used for keeping away web pages out of google. For this purpose, we can use noindex. directives or password-protect our web page.

What is robots.txt

What is robots.txt used for?

To manage traffic on the web page

We can use robots.txt to manage the crawling traffic in case if we feel that our web server will be overwhelmed by requests from google crawlers. We can avoid crawling unimportant or similar pages on our website.

We should not use robots.txt to hide our web page from the Google search result because in case other pages point to our page along with descriptive text then our page could however be indexed without visiting the page.

To manage traffic and hide media file from google

We can use robots.txt to manage the traffic and preventing image, video, and audio files from appearing in the google search results. But this won’t prevent the users or other pages from linking to the images, videos, audio files on the webserver.

To manage traffic and hide resource file from google

We can use robots.txt to block resource files like unimportant image, script, style files. After blocking the resources the web crawler will not be able to understand the page and thus it will affect the analysis of the page that depends on these resources.

Learn What is .htaccess File

How to create robots.txt file?

A new robots.txt file can be created by using a plain text editor of choice. In case, if we already have a robots.txt file we should make sure that we have deleted the text inside the file.

  • Set the user agent
    Start making the file by setting up the user agent.
    We can do this by using asterisk after writing a user-agent term.
  • Next, type “disallow”. Do not type anything after disallow.
  • Next, there is nothing after the disallow so the web robots will be directed to crawl our entire website. Our robots.txt file will be looking like this:
  • We can link the XML sitemap to this. It is completely your choice.

How to create robots.txt file

How to test robots.txt file?

  • Start by opening the tester tool for the site, and scroll down through the robots.txt code to locate the highlighted syntax warnings and logic errors. The number of syntax warnings and logic errors will be shown immediately below the editor.
  • Type in the URL of a page on your site in the text box which is at the bottom of the page.
  • Select the user-agent you want to simulate in the dropdown list which is located to the right of the text box.
  • Click the TEST button to test access.
  • Check to see if the TEST button now reads ACCEPTED or BLOCKED to find out if the URL you entered is blocked from Google web crawlers.
  • Edit the file on the page and retest as required. Note that changes made on the page are not saved to your site! See the next step.
  • Copy the changes to your robots.txt file on the web site. By using this tool we can not make changes to the actual file on the site, it only tests against the copy hosted in the tool.

How to test robots.txt file


  1. You’ve made some decent points there. I checked on the internet for more info about the issue
    and found most individuals will go along with your views on this web site.
    Ahaa, its good dialogue about this post here at this web site, I have read all that, so now me also commenting here. I’ve been browsing on-line
    greater than 3 hours these days, yet I never discovered any interesting article like yours.
    It is beautiful price sufficient for me. In my opinion, if all website owners and bloggers made just right content material as you
    did, the internet shall be much more helpful than ever before.

  2. Hello, my family member! I wish to say that this article is awesome,
    great written and include almost all significant Infos. I would like to peer extra posts like this.

  3. Good day! This is my first visit to your blog! We are
    a team of volunteers and starting a new initiative in a community in the same niche.
    Your blog provided us valuable information to work on. You have done a marvelous job!

  4. Post writing is also a excitement, if you be acquainted with then you can write otherwise
    it is complex to write.

  5. Amazing blog! Is your theme custom made or did
    you download it from somewhere? A design like yours with a few simple adjustements would really make my blog stand out.
    Please let me know where you got your design. Thank you

  6. Aw, this was a very good post. Taking the time and actual effort to produce a good article? but what can I say?
    I procrastinate a lot and never manage to get anything done.

  7. Simply wish to say your article is as astounding. The clearness on your post is just spectacular and that i can think you’re a professional
    in this subject. Fine with your permission let me to take hold of your RSS feed to stay
    up to date with impending post. Thank you one million and please
    carry on the gratifying work.


Please enter your comment!
Please enter your name here