Optimizing Robots Text File

Optimizing robots text file is really important, if it's notis using robots.txt now let's start writing in robots.txt
done then search engine bots might crawl yourBasic syntax of robots.txt is
website for confidential information and can displayUser-Agent: [Spider or Bot name]
them in their respective search engines or if you areDisallow: [Directory or File Name]
using robots .txt file but it's not written properly then itYou can repeat these lines for blocking different
can be one of the scenarios that it might block searchdirectories or giving different instructions to different
engine from crawling the website.spiders. Let's get in few examples that will make it
We can block spiders to crawl restricted parts of ourmore clear.
website. Restricted parts of our website means thoseExample 1) Exclude a file named private.html in private
links of our website which we don't want to befolder from being crawled by Google-bot.
indexed in search engines and getting some unwantedSolution 1) In this scenario you can write the following
visitors. For example:-code in robots.txt
How many of you would be interested in indexing yourUser-Agent: Googlebot
administration page in search engine?Disallow: /private/private.html
In past while I have seen some scenarios in whichExample 2) Exclude a folder named private from being
website owners were paranoid in using robots.txt incrawled by search engine.
their website as they were scared that this will harmSolution 2) In this scenario you can write the following
SEO. Well this is not true, If we can use robots .txtcode in robots.txt
properly then we can stop the crawler fromUser-Agent: *
particularly crawling restricted links and it will crawlDisallow: /private/
every other link which we will not restrict and it will notExample 3) Instruct Search Engine bots to crawl and
even harm SEO of our website. We can accomplishindex everything on the website.
this task by using robots .txt.Solution 3) In this scenario you can write the following
Before we can discuss optimization and can take thecode in robots.txt
full advantage of robots .txt, we should first discussUser-Agent: *
the basic concepts of robots .txtDisallow:
A robots .txt is a text file that has to be placed in theExample 4) Instruct Search Engine bots that they
root folder of your web server (where you placeshould not crawl or index any part of the website.
index page of your website). You can simple createSolution 4) In this scenario you can write the following
this file in a notepad. It tells various search engine botscode in robots.txt
that which part of website should not be crawled orUser-Agent: *
should not be indexed. By using this we can instructDisallow: /
bots to prevent our website from being crawled or weExample 5) Exclude multiple folders
can instruct them that they should not crawl or index(private1,private2,private3) from being crawled by
certain areas of the website. Even we can use samesearch engines.
robots .txt to give different instructions to differentSolution 5) In this scenario you can write the following
bots.code in robots.txt
Even if you don't want to protect any area of yourUser-Agent: *
website from indexing or crawling, still you should useDisallow: /private1/
robots .txt as it can act as a open invitation for searchDisallow: /private2/
engines to crawl your complete website.Disallow: /private3/
There can be several scenarios in which you might beExample 6) Instruct Google-bot to crawl everything on
interested in blocking Search Engine Bots fromthe website and instruct Alexa bot that it should not
crawling certain parts of your website.crawl any part of the website
For exampleSolution 6) In this scenario you can write the following
1) Protecting your administration panel of your website.code in robots.txt
2) Protecting your under construction pages fromUser-Agent: Googlebot
getting indexed in search engines.Disallow:
3) Protecting directory that you don't want to beUser-Agent: Alexa
indexed like cgi-binDisallow: /
4) Protecting pages that have email addresses asI am sure that after reading this article you have got
they can be used by spammers if got indexed inthe fair idea about robots .txt and you can now use
search engines.robots .txt to aid SEO of your site.
Reasons can be various but the solution is same, that