History
\nThe standard was proposed byStandard
\nWhen a site owner wishes to give instructions to web robots they place a text file called in the root of the web site hierarchy (e.g. ). This text file contains the instructions in a specific format (see examples below). Robots that choose to follow the instructions try to fetch this file and read the instructions before fetching any other file from theCompliance
\nThe robots.txt protocol is widely complied with by bot operators. \nSearch engines
\nSome majorArchival sites
\nSome web archiving projects ignore robots.txt. Archive Team uses the file to discover more links, such as sitemaps.<\/ref> Co-founder Jason Scott said that \"unchecked, and left alone, the robots.txt file ensures no mirroring or reference for items that may have general use and meaning beyond the website's context.\"<\/ref> In 2017, theArtificial intelligence
\nStarting in the 2020s, web operators began using robots.txt to deny access to bots collecting training data forSecurity
\nDespite the use of the terms ''allow'' and ''disallow'', the protocol is purely advisory and relies on the compliance of the web robot; it cannot enforce any of what is stated in the file. <\/ref> Malicious web robots are unlikely to honor robots.txt; some may even use the robots.txt as a guide to find disallowed links and go straight to them. While this is sometimes claimed to be a security risk,<\/ref> this sort of ''Alternatives
\nMany robots also pass a specialhumans.txt<\/code> file that displays information meant for humans to read.<\/ref> Some sites such as GitHub
GitHub () is a Proprietary software, proprietary developer platform that allows developers to create, store, manage, and share their code. It uses Git to provide distributed version control and GitHub itself provides access control, bug trackin ...
redirect humans.txt to an ''About'' page.<\/ref>\n\nPreviously, Google had a joke file hosted at \/killer-robots.txt<\/code> instructing the Terminator
''The Terminator'' is a 1984 American science fiction action film directed by James Cameron, written by Cameron and Gale Anne Hurd and produced by Hurd. It stars Arnold Schwarzenegger as the Terminator, a cybernetic assassin sent back in t ...
not to kill the company founders Larry Page
Lawrence Edward Page (born March 26, 1973) is an American businessman, computer engineer and computer scientist best known for co-founding Google with Sergey Brin.
Page was chief executive officer of Google from 1997 until August 2001 when ...
and Sergey Brin
Sergey Mikhailovich Brin (; born August 21, 1973) is an American computer scientist and businessman who co-founded Google with Larry Page. He was the president of Google's parent company, Alphabet Inc., until stepping down from the role on D ...
.<\/ref><\/ref>\n
Examples
\nThis example tells all robots that they can visit all files because the wildcard *<\/code> stands for all robots and the Disallow<\/code> directive has no value, meaning no pages are disallowed. Search engine giant Google open-sourced their robots.txt parser,<\/ref> and recommends testing and validating rules on the robots.txt file using community-built testers such as Tame the Bots <\/ref> and Real Robots Txt.<\/ref> \n\n\nUser-agent: *\nDisallow: \n<\/pre>\n\nThis example has the same effect, allowing all files rather than prohibiting none.\n\n\nUser-agent: *\nAllow: \/\n<\/pre>\n\nThe same result can be accomplished with an empty or missing robots.txt file.\n\nThis example tells all robots to stay out of a website:\n\n\nUser-agent: *\nDisallow: \/\n<\/pre>\n\nThis example tells all robots not to enter three directories:\n\n\nUser-agent: *\nDisallow: \/cgi-bin\/\nDisallow: \/tmp\/\nDisallow: \/junk\/\n<\/pre>\n\nThis example tells all robots to stay away from one specific file:\n\n\nUser-agent: *\nDisallow: \/directory\/file.html\n<\/pre>\n\nAll other files in the specified directory will be processed.\n\n\nThis example tells one specific robot to stay out of a website:\n\n\nUser-agent: BadBot # replace 'BadBot' with the actual user-agent of the bot\nDisallow: \/\n<\/pre>\n\nThis example tells two specific robots not to enter one specific directory:\n\n\nUser-agent: BadBot # replace 'BadBot' with the actual user-agent of the bot\nUser-agent: Googlebot\nDisallow: \/private\/\n<\/pre>\n\nExample demonstrating how comments can be used:\n\n\n# Comments appear after the \"#\" symbol at the start of a line, or after a directive\nUser-agent: * # match all bots\nDisallow: \/ # keep them out\n<\/pre>\n\nIt is also possible to list multiple robots with their own rules. The actual robot string is defined by the crawler. A few robot operators, such as Google
Google LLC (, ) is an American multinational corporation and technology company focusing on online advertising, search engine technology, cloud computing, computer software, quantum computing, e-commerce, consumer electronics, and artificial ...
, support several user-agent strings that allow the operator to deny access to a subset of their services by using specific user-agent strings.\n\nExample demonstrating multiple user-agents:\n\n\nUser-agent: googlebot # all Google services\nDisallow: \/private\/ # disallow this directory\n\nUser-agent: googlebot-news # only the news service\nDisallow: \/ # disallow everything\n\nUser-agent: * # any robot\nDisallow: \/something\/ # disallow this directory\n<\/pre>\n
The use of the wildcard * in rules
\nThe directive Disallow: \/something\/<\/code> blocks all files and subdirectories starting with \/something\/<\/code>.\n\nIn contrast using a wildcard, (if supported by the crawler), allows for more complex patterns in specifying paths and files to allow or disallow from crawling, for example Disallow: \/something\/*\/other<\/code> blocks URLs such as:\n\/something\/foo\/other\n\/something\/bar\/other\n<\/pre>\n\nIt would not prevent the crawling of \/something\/foo\/else<\/code>, as that would not match the pattern.\n\nThe wildcard *<\/code> allows greater flexibility but may not be recognized by all crawlers, although it is part of the Robots Exclusion Protocol RFC <\/ref>\n\nA wildcard at the end of a rule in effect does nothing, as that is the standard behaviour.\n
Nonstandard extensions
\n
Crawl-delay directive
\nThe crawl-delay value is supported by some crawlers to throttle their visits to the host. Since this value is not part of the standard, its interpretation is dependent on the crawler reading it. It is used when the multiple burst of visits from bots is slowing down the host. Yandex interprets the value as the number of seconds to wait between subsequent visits. Bing defines crawl-delay as the size of a time window (from 1 to 30 seconds) during which BingBot will access a web site only once.<\/ref> Google ignores this directive,<\/ref> but provides an interface in its search console for webmasters, to control the Googlebot
Googlebot is the web crawler software used by Google that collects documents from the web to build a searchable index for the Google Search engine. This name is actually used to refer to two different types of web crawlers: a desktop crawler (to ...
's subsequent visits.<\/ref>\n\n\nUser-agent: bingbot\nAllow: \/\nCrawl-delay: 10\n<\/pre>\n
Sitemap
\nSome crawlers support a Sitemap<\/code> directive, allowing multiple Sitemaps
Sitemaps is a protocol in XML format meant for a webmaster to inform search engines about URLs on a website that are available for web crawling. It allows webmasters to include additional information about each URL: when it was last updated, h ...
in the same robots.txt<\/samp> in the form Sitemap: ''full-url''<\/code>:<\/ref><\/ref>\nSitemap: http:\/\/www.example.com\/sitemap.xml<\/pre>\n
Universal \"*\" match
\nThe ''Robot Exclusion Standard'' does not mention the \"*\" character in the Disallow:<\/code> statement.<\/ref>\n
Meta tags and headers
\nIn addition to root-level robots.txt files, robots exclusion directives can be applied at a more granular level through the use of Robots meta tags and X-Robots-Tag HTTP headers. The robots meta tag cannot be used for non-HTML files such as images, text files, or PDF documents. On the other hand, the X-Robots-Tag can be added to non-HTML files by using .htaccess and
files.<\/ref>\n
A \"noindex\" meta tag
\n\n\n<\/syntaxhighlight>\n
A \"noindex\" HTTP response header
\n\nX-Robots-Tag: noindex\n<\/syntaxhighlight>\n\nThe X-Robots-Tag is only effective after the page has been requested and the server responds, and the robots meta tag is only effective after the page has loaded, whereas robots.txt is effective before the page is requested. Thus if a page is excluded by a robots.txt file, any robots meta tags or X-Robots-Tag headers are effectively ignored because the robot will not see them in the first place.\n
Maximum size of a robots.txt file
\nThe Robots Exclusion Protocol requires crawlers to parse at least 500 kibibytes (512000 bytes) of robots.txt files, which Google maintains as a 500 kibibyte file size restriction for robots.txt files.<\/ref>\n
See also
\n\n\n* ads.txt<\/code>, a standard for listing authorized ad sellers\n* security.txt<\/code>, a file to describe the process for security researchers to follow in order to report security vulnerabilities\n* eBay v. Bidder's Edge\n* Automated Content Access Protocol \u2013 A failed proposal to extend robots.txt\n* BotSeer \u2013 Now inactive search engine for robots.txt files\n* Distributed web crawling\n* Focused crawler\n* Internet Archive
The Internet Archive is an American 501(c)(3) organization, non-profit organization founded in 1996 by Brewster Kahle that runs a digital library website, archive.org. It provides free access to collections of digitized media including web ...
\n* Meta elements for search engines\n* National Digital Library Program
The National Digital Library Program (NDLP) is a project by the United States Library of Congress to assemble a digital library of reproductions of primary source materials to support the study of the history and culture of the United States. ...
(NDLP)\n* National Digital Information Infrastructure and Preservation Program
The National Digital Information Infrastructure and Preservation Program (NDIIPP) of the United States was an archival program led by the Library of Congress to preserve and provide access to digital resources. The program convened several workin ...
(NDIIPP)\n* nofollow
nofollow is a setting on a web page hyperlink that directs search engines not to use the link for page ranking calculations. It is specified in the page as a type of link relation; that is: <a rel="nofollow" ...>. Because search engi ...
\n* noindex
The noindex value of an HTML robots meta tag requests that automated Internet bots avoid Search engine indexing, indexing a web page.Perma.cc
Perma.cc is a web archiving service for legal and academic citations founded by the Harvard Library Innovation Lab in 2013.
Concept
Perma.cc was created in response to studies showing high incidences of link rot in both academic publications an ...
\n* Sitemaps
Sitemaps is a protocol in XML format meant for a webmaster to inform search engines about URLs on a website that are available for web crawling. It allows webmasters to include additional information about each URL: when it was last updated, h ...
\n* Spider trap\n* Web archiving
Web archiving is the process of collecting, preserving, and providing access to material from the World Wide Web. The aim is to ensure that information is preserved in an archival format for research and the public.
Web archivists typically ...
\n* Web crawler
Web crawler, sometimes called a spider or spiderbot and often shortened to crawler, is an Internet bot that systematically browses the World Wide Web and that is typically operated by search engines for the purpose of Web indexing (''web spider ...
\n\n
References
\n\n
Further reading
\n* \n
External links
\n\n* \n\n\n\n{{DEFAULTSORT:Robots Exclusion Standard\n Search engine optimization\n Websites\n Web scraping\n Text files"