How to use robots.txt
What is the purpose of the robots file?
When a search engine crawls (visits) your website, the first thing it looks for is your robots.txt file. This file tells search engines what they should and should not index (save and make available as search results to the public). It also may indicate the location of your XML sitemap. The search engine then sends its "bot" or "robot" or "spider" to crawl your site as directed in the robots.txt file (or not send it, if you said they could not).
Google's bot is called Googlebot, and Microsoft Bing's bot is called Bingbot. Many other search engines, like Excite, Lycos, Alexa and Ask Jeeves also have their own bots. Most bots are from search engines, although sometimes other sites send out bots for various reasons. For example, some sites may ask you to put code on your website to verify you own that website, and then they send a bot to see if you put the code on your site.
Where does robots.txt go?
The robots.txt file belongs in yourÂ document root folder.
You can simply create a blank file and name itÂ robots.txt. This will reduce site errors and allow all search engines to rank anything they want.
Blocking Robots and Search Engines from Crawling
If you want toÂ stop bots from visiting you site andÂ stop search engines from ranking you, use this code:
You can also prevent robots from crawling parts of your site, while allowing them to crawl other sections. The following example would request search engines and robots not to crawl the cgi-bin folder, the tmp folder, and the junk folder and everything in those folders on your website.
In the above example, http://www.yoursitesdomain.com/junk/index.html would be one of the URLs blocked, but http://www.yoursitesdomain.com/index.html and http://www.yoursitesdomain.com/someotherfolder/ would be crawlable.
Was this answer helpful?
Creating a database and user: Step 1: Login to your cpanel to create a database. Step 2:...
Shared packages (including Cloud Sites and Resellers) are hosted on carefully managed...
A bad but very common practice on the internet is hotlinking: What is hotlinking? Here is a...
How to visit a website instantly after migration The preferred method is to modify the hosts...