Robots Exclusion Standard
From Wikipedia, the free encyclopedia
The robots exclusion standard or robots.txt protocol is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a website. The information specifying the parts that should not be accessed is specified in a file called robots.txt in the top-level directory of the website.
The robots.txt protocol was created by consensus in June 1994 by members of the robots mailing list (robots-request@nexor.co.uk). There is no official standards body or RFC for the protocol.
The protocol is purely advisory. It relies on the cooperation of the web robot, so that marking an area of your site out of bounds with robots.txt does not guarantee privacy. Many web site administrators have been caught trying to use the robots file to make private parts of a website invisible to the rest of the world. However, the file is necessarily publicly available and is easily checked by anyone with a web browser.
The robots.txt patterns are matched by simple substring comparisons, so care should be taken to make sure that patterns matching directories have the final '/' character appended, otherwise all files with names starting with that substring will match, rather than just those in the directory intended.
Contents |
[edit] Examples
This example allows all robots to visit all files because the wildcard "*" specifies all robots:
User-agent: * Disallow:
This example keeps all robots out:
User-agent: * Disallow: /
The next is an example that tells all crawlers not to enter into four directories of a website:
User-agent: * Disallow: /cgi-bin/ Disallow: /images/ Disallow: /tmp/ Disallow: /private/
Example that tells a specific crawler not to enter one specific directory:
User-agent: BadBot Disallow: /private/
Example demonstrating how comments can be used:
# Comments appear after the "#" symbol at the start of a line, or after a directive User-agent: * # match all bots Disallow: / # keep them out
[edit] Compatibility
In order to prevent access to all pages by robots,
Disallow: *
is not appropriate as this is not a stable standard extension.
Instead:
Disallow: /
should be used.
[edit] Extended Standard
An Extended Standard for Robot Exclusion has been proposed, which adds several new directives, such as Visit-time and Request-rate. For example:
User-agent: * Disallow: /downloads/ Request-rate: 1/5 # maximum rate is one page every 5 seconds Visit-time: 0600-0845 # only visit between 6:00 AM and 8:45 AM UT (GMT)
[edit] Alternatives
robots.txt is older and more widely accepted, but there are other methods (which can be used together with robots.txt) that allow greater control, like disabling indexing of images only or disabling archiving of page contents.
[edit] HTML meta tags for robots
HTML meta tags can be used to exclude robots according to the contents of web pages. Again, this is purely advisory, and also relies on the cooperation of the robot programs. For example,
<meta name="robots" content="noindex,nofollow" />
within the HEAD
section of an HTML document tells search engines such as Google, Yahoo!, or MSN to exclude the page from its index and not to follow any links on this page for further possible indexing.
(See HTML Author's Guide to the Robots META tag.)
[edit] Directives within a page
The <NOINDEX> tag is a non-standard HTML tag whose intent is to indicate portions of a page that should not be indexed, such as common navigation or footer. Using it without a namespace will make XHTML pages invalid.
[edit] Automated Content Access Protocol
The proposed Automated Content Access Protocol will include functionality to allow a more sophisticated set of permissions to be communicated to robots.
[edit] References
[edit] See also
[edit] External links
- How to keep bad robots, spiders and web crawlers away
- robots.txt File (tutorial on how and why to add a robots.txt file to websites, July 19, 2004)
- HOWTO: Serving up default favicon.ico and robots.txt files with Apache
- Robots.txt Checker (validates robots.txt files and gives optimization tips)
- A Standard for Robot Exclusion
- Robots Exclusion
- Robots.txt Russian Page
- An Extended Standard for Robot Exclusion
- Robots.txt Online Generator
- RoboGen - Shareware Windows program for creating and editing robot exclusion files
- Comprehensive Robots.txt Tutorial
- Using Robots.txt To Manage Search Engine Spiders
- Yahoo! Search Crawler (Yahoo! Slurp) - Supporting wildcards in robots.txt
- Bot-trap - bans bots that ignore robots.txt but allow human unban
- List of user agents