What is Robots.txt and How does it work?

What is Robots.txt and How does it work ?, What is Robots.txt ?

What is Robots.txt and How does it work? Have you ever heard of it, if not, it's a matter of scratching for you today because today you're going to provide people with some information about Robots.txt? If you have a blog or website, you must have felt that sometimes all the information we don't want to become public on the Internet, do you know why. Because many of our good contents didn't even index after a long time. If you need to know about the secret behind all these things, you need to read all these article Robots.txt carefully so that you will know all these things until the end of the article.

Search Engines have to tell you that files and Folders are used to show files and Folders to all public on the website and what robots metatag is used to do not. But not all Search Engines read Metatags, so many Robots go unnoticed without metatag. The best way to do this is to use Robots.txt File so that Search Engines can be easily informed about files and Folders in your Website or Blog. So today I thought that you should not give you full information about what robots.txt is so that you don't have any difficulty in understanding it any further. Then let's start with the delay and know What is Robots.txt and How does it work? 

What is Robots.txt?

Robots.txt is a text file that you keep on your site so that you can tell Search Robots which pages to visit or crawl in your site and who doesn’t. Although following robots.txt is not mandatory for search engines, they must pay attention to it and do not visit the pages and folders mentioned in it. Robots.txt is very important accordingly. Therefore, it is very important to keep it in the main directory so that it is easy to find the search engine.

What's worth noting here is that if we don't implement this file in the right place, Search Engines may feel that you haven't included the robot.txt file so that your site pages may not even be indexed. So this small file has a lot of importance if it is not used properly, it can also reduce your website ranking. Therefore, it is very important to have a good knowledge of it.

How does it work?

Any search engines or Web Spiders, if your website or blog have come up for the first time, first crawl your robot.txt file because it contains all the information about your website about what to do and who to do. And they index your guided pages so that your indexed pages are displayed in search engine results.

Robots.txt files can prove to be very beneficial for you if:
  • You want search engines to ignore the duplicate pages on your website
  • If you don't want your internal search results pages to index
  • If you want search engines not to index some of the pages you direct
  • If you don't want some of your files like some images, PDFs, etc.
  • If you want search engines to tell where your sitemap is

How to create a Robots.txt file?

If you haven't yet created a robots.txt file in your website or blog, you should make it very quickly because it's going to be very healthy for you in the future. To create it, you need to follow some instructions:
First, create a text file and save it in the name of robots.txt. For this, you can use Notepad or any other text editor.
Now upload it to the root directory of your website. Which is a root-level folder and is also called "htdocs" and appears after your domain name.
If you use subdomains, you need to create separate robots.txt files for all subdomains.

Syntax’s of Robots.txt?

At Robots.txt we use some syntax that we need to know about.
  • User-Agent: Robots that follow all these rules and are applicable (e.g. "Googlebot," etc.)
  • Disallow: Using this means blocking pages with bots that you don't want anyone else to access. (Here's the first disallow write per files)
  • Noindex: The search engine will not index your pages that you don't want to be indexed.
  • Use a blank line to separate all User-Agent/Disallow groups, but note here that the two groups should not have any blank line (user-agent line and the last Disallow should not have a gap.
  • Hash symbol (#) can be used to give comments within a robots.txt file, where everything that will be the first # symbol will be ignored. These are mainly used for whole lines or end of lines.
  • Directories and filenames are case-sensitive: "private", "Private", and "PRIVATE" are completely different for all search engines.
  • I am going to explain this with the help of an example so, you can understand it easily. Here below, I have written about him.
  • The robot "Googlebot" here doesn't have any disallowed statement written so that it's free to go anywhere
  • All site has been closed where "msnbot" has been used
  • All robots (other than Googlebot) are used to /tmp/tmp. There is no permission to view directories or directories or files /logs, which have been explained below comments via e.g., tmp, .htm.
/logs or logs.php.
User-agent: Googlebot
User-agent: msnbot
Disallow: /
# Block all robots from tmp and logs directories
User-agent: *
Disallow: /tmp/
Disallow: /logs # for directories and files called logs

Advantages of using Robots.txt

However, there is a lot of use of robots.txt, but I have here to tell you about some very important fa-give that everyone should be aware of.

  • Your sensitive information can be kept private with the use of robots.txt.
  • Robots.txt can help to keep "canonicalization" problems away or multiple "canonical" URLs can also be kept. This problem is also known as a forgotten "duplicate content" problem.
  • This allows you to help Google Bots Index Pages.

What if we don't use the robots.txt file?

If we don't use any robots.txt file, there's no restriction on search engines where to crawl and where not to index everything they find on your website. It's all for many websites, but if we talk about some good practice, we should use the robots.txt file because it makes search engines easier to index your pages, and they don't need to go to all pages again and again.


I sincerely hope that I gave you people full information about What is Robots.txt and How does it work? and I hope you guys will have understood about Robots.txt. I'm all aware of all your readers that you also share this information with your neighbors, relatives, your friends, which will lead to our awareness and benefit everyone. I need the support of you people so that I can reach out to you with more new information.

If you are facing any problem then you can contact me on telegram, I'll try to solve those doubts. You must write this article Robots.txt how it felt to write to us a comment so that we too get a chance to learn something from your thoughts and improve something.

Information Shared by Aman Chourasia