Revision as of 22:40, 9 May 2023 edit191.135.210.168 (talk) Hallo, welcome to my home page!Tags: Reverted Mobile edit Mobile web edit← Previous edit | Latest revision as of 08:31, 28 December 2024 edit undoWikiCleanerBot (talk | contribs)Bots926,203 editsm v2.05b - Bot T19 CW#25 - Fix errors for CW project (Heading hierarchy)Tag: WPCleaner | ||
(157 intermediate revisions by more than 100 users not shown) | |||
Line 1: | Line 1: | ||
{{ |
{{Short description|Filename used to indicate portions for web crawling}} | ||
{{ |
{{Lowercase}} | ||
{{ |
{{Selfref|For Misplaced Pages's robots.txt file, see https://en.wikipedia.org/robots.txt.}} | ||
{{ |
{{Pp-pc1}} | ||
{{ |
{{Pp-pc|small=yes}} | ||
{{Infobox technology standard | |||
'''robots.txt''' is a standard used by ]s to indicate to visiting ]s and other ] which portions of the website they are allowed to visit. | |||
| title = robots.txt | |||
| long_name = Robots Exclusion Protocol | |||
| image = Robots txt.svg | |||
| image_size = | |||
| alt = | |||
| caption = Example of a simple robots.txt file, indicating that a user-agent called "Mallorybot" is not allowed to crawl any of the website's pages, and that other user-agents cannot crawl more than one page every 20 seconds, and are not allowed to crawl the "secret" folder | |||
| abbreviation = | |||
| native_name = <!-- Name in local language. If more than one, separate using {{plain list}} --> | |||
| native_name_lang = <!-- ISO 639-1 code e.g. "fr" for French. If more than one, use {{lang}} inside native_name items instead --> | |||
| status = Proposed Standard | |||
| year_started = <!-- {{Start date|YYYY|MM|DD|df=y}} --> | |||
| first_published = 1994 published, formally standardized in 2022 | |||
| version = | |||
| version_date = | |||
| preview = | |||
| preview_date = | |||
| organization = | |||
| committee = | |||
| series = | |||
| editors = | |||
| authors = {{plain list| | |||
* Martijn Koster (original author) | |||
* Gary Illyes, Henner Zeller, Lizzi Sassman (IETF contributors) | |||
}} | |||
| base_standards = | |||
| related_standards = | |||
| predecessor = | |||
| successor = | |||
| domain = | |||
| license = | |||
| copyright = | |||
| website = {{URL|https://robotstxt.org}}, {{URL|https://datatracker.ietf.org/doc/html/rfc9309|RFC 9309}} | |||
}} | |||
'''robots.txt''' is the ] used for implementing the '''Robots Exclusion Protocol''', a standard used by ]s to indicate to visiting ]s and other ] which portions of the website they are allowed to visit. | |||
The standard, developed in 1994, relies on ]. Malicious bots can use the file as a directory of which pages to visit, though standards bodies discourage countering this with ]. Some archival sites ignore robots.txt. The standard was used in the 1990s to mitigate ] overload. In the 2020s, websites began denying bots that collect information for ]. | |||
⚫ | The " |
||
⚫ | The "robots.txt" file can be used in conjunction with ], another robot inclusion standard for websites. | ||
==History== | ==History== | ||
The standard was proposed by ],<ref>{{cite web |url=http://www.greenhills.co.uk/historical.html |title=Historical |website=Greenhills.co.uk |access-date=2017-03-03 |archive-url=https://web.archive.org/web/20170403152037/http://www.greenhills.co.uk/historical.html |archive-date=2017-04-03 |url-status=live }}</ref><ref>{{cite web |title=Maintaining Distributed Hypertext Infostructures: Welcome to MOMspider's Web |first=Roy |last=Fielding |work=First International Conference on the World Wide Web |year=1994 |place=Geneva |url=http://www94.web.cern.ch/WWW94/PapersWWW94/fielding.ps |access-date=September 25, 2013 |format=PostScript |archive-url=https://web.archive.org/web/20130927093658/http://www94.web.cern.ch/WWW94/PapersWWW94/fielding.ps |archive-date=2013-09-27 |url-status=live }}</ref> when working for ]<ref name=":0">{{cite web |url=http://www.robotstxt.org/orig.html#status |title=The Web Robots Pages |publisher=Robotstxt.org |date=1994-06-30 |access-date=2013-12-29 |archive-url=https://web.archive.org/web/20140112090633/http://www.robotstxt.org/orig.html#status |archive-date=2014-01-12 |url-status=live }}</ref> in February 1994<ref> | The standard was proposed by ],<ref>{{cite web |url=http://www.greenhills.co.uk/historical.html |title=Historical |website=Greenhills.co.uk |access-date=2017-03-03 |archive-url=https://web.archive.org/web/20170403152037/http://www.greenhills.co.uk/historical.html |archive-date=2017-04-03 |url-status=live }}</ref><ref>{{cite web |title=Maintaining Distributed Hypertext Infostructures: Welcome to MOMspider's Web |first=Roy |last=Fielding |work=First International Conference on the World Wide Web |year=1994 |place=Geneva |url=http://www94.web.cern.ch/WWW94/PapersWWW94/fielding.ps |access-date=September 25, 2013 |format=PostScript |archive-url=https://web.archive.org/web/20130927093658/http://www94.web.cern.ch/WWW94/PapersWWW94/fielding.ps |archive-date=2013-09-27 |url-status=live }}</ref> when working for ]<ref name=":0">{{cite web |url=http://www.robotstxt.org/orig.html#status |title=The Web Robots Pages |publisher=Robotstxt.org |date=1994-06-30 |access-date=2013-12-29 |archive-url=https://web.archive.org/web/20140112090633/http://www.robotstxt.org/orig.html#status |archive-date=2014-01-12 |url-status=live }}</ref> in February 1994<ref>{{cite web|title=Important: Spiders, Robots and Web Wanderers |first=Martijn |last=Koster |work=www-talk mailing list |date=25 February 1994 |url=http://inkdroid.org/tmp/www-talk/4113.html |format=] archived message |url-status=dead |archive-url=https://web.archive.org/web/20131029200350/http://inkdroid.org/tmp/www-talk/4113.html |archive-date=October 29, 2013 }}</ref> on the ''www-talk'' mailing list, the main communication channel for WWW-related activities at the time. ] claims to have provoked Koster to suggest robots.txt, after he wrote a badly behaved web crawler that inadvertently caused a ] on Koster's server.<ref>{{cite web |url=http://www.antipope.org/charlie/blog-static/2009/06/how_i_got_here_in_the_end_part_3.html |title=How I got here in the end, part five: "things can only get better!" |work=Charlie's Diary |date=19 June 2006 |access-date=19 April 2014 |archive-url=https://web.archive.org/web/20131125220913/http://www.antipope.org/charlie/blog-static/2009/06/how_i_got_here_in_the_end_part_3.html |archive-date=2013-11-25 |url-status=live }}</ref> | ||
{{cite web|title=Important: Spiders, Robots and Web Wanderers |first=Martijn |last=Koster |work=www-talk mailing list |date=25 February 1994 |url=http://inkdroid.org/tmp/www-talk/4113.html |format=] archived message |url-status=dead |archive-url=https://web.archive.org/web/20131029200350/http://inkdroid.org/tmp/www-talk/4113.html |archive-date=October 29, 2013 }}</ref> on the ''www-talk'' mailing list, the main communication channel for WWW-related activities at the time. ] claims to have provoked Koster to suggest robots.txt, after he wrote a badly-behaved web crawler that inadvertently caused a ] on Koster's server.<ref>{{cite web |url=http://www.antipope.org/charlie/blog-static/2009/06/how_i_got_here_in_the_end_part_3.html |title=How I got here in the end, part five: "things can only get better!" |work=Charlie's Diary |date=19 June 2006 |access-date=19 April 2014 |archive-url=https://web.archive.org/web/20131125220913/http://www.antipope.org/charlie/blog-static/2009/06/how_i_got_here_in_the_end_part_3.html |archive-date=2013-11-25 |url-status=live }}</ref> | |||
The standard, initially RobotsNotWanted.txt, allowed ]s to specify which bots should not access their website or which pages bots should not access. The internet was small enough in 1994 to maintain a complete list of all bots; ] overload was a primary concern. By June 1994 it had become a ];<ref name="Verge">{{cite web|url=https://www.theverge.com/24067997/robots-txt-ai-text-file-web-crawlers-spiders|title=The text file that runs the internet|work=]|last=Pierce|first=David|date=14 February 2024|accessdate=16 March 2024}}</ref> most complied, including those operated by search engines such as ], ], and ].<ref name="sear_Robo">{{cite web |title=Robots.txt Celebrates 20 Years Of Blocking Search Engines |author=Barry Schwartz |work=Search Engine Land |date=30 June 2014 |access-date=2015-11-19 |url=http://searchengineland.com/robots-txt-celebrates-20-years-blocking-search-engines-195479 |archive-url=https://web.archive.org/web/20150907000430/http://searchengineland.com/robots-txt-celebrates-20-years-blocking-search-engines-195479 |archive-date=2015-09-07 |url-status=live }}</ref> | |||
On July 1, 2019, Google announced the proposal of the Robots Exclusion Protocol as an official standard under ].<ref>{{Cite web|url=https://webmasters.googleblog.com/2019/07/rep-id.html|title=Formalizing the Robots Exclusion Protocol Specification|website=Official Google Webmaster Central Blog|language=en|access-date=2019-07-10 |
On July 1, 2019, Google announced the proposal of the Robots Exclusion Protocol as an official standard under ].<ref>{{Cite web|url=https://webmasters.googleblog.com/2019/07/rep-id.html|title=Formalizing the Robots Exclusion Protocol Specification|website=Official Google Webmaster Central Blog|language=en|access-date=2019-07-10|archive-date=2019-07-10|archive-url=https://web.archive.org/web/20190710060436/https://webmasters.googleblog.com/2019/07/rep-id.html|url-status=live}}</ref> A proposed standard{{Ref RFC|9309}} was published in September 2022 as RFC 9309. | ||
==Standard== | ==Standard== | ||
When a site owner wishes to give instructions to web robots they place a text file called {{mono|robots.txt}} in the root of the web site hierarchy (e.g. {{mono|<nowiki>https://www.example.com/robots.txt</nowiki>}}). This text file contains the instructions in a specific format (see examples below). Robots that |
When a site owner wishes to give instructions to web robots they place a text file called {{mono|robots.txt}} in the root of the web site hierarchy (e.g. {{mono|<nowiki>https://www.example.com/robots.txt</nowiki>}}). 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 the ]. If this file does not exist, web robots assume that the website owner does not wish to place any limitations on crawling the entire site. | ||
A robots.txt file contains instructions for bots indicating which web pages they can and cannot access. Robots.txt files are particularly important for web crawlers from search engines such as Google. | A robots.txt file contains instructions for bots indicating which web pages they can and cannot access. Robots.txt files are particularly important for web crawlers from search engines such as Google. | ||
Line 27: | Line 61: | ||
A robots.txt file covers one ]. For websites with multiple subdomains, each subdomain must have its own robots.txt file. If {{mono|example.com}} had a robots.txt file but {{mono|a.example.com}} did not, the rules that would apply for {{mono|example.com}} would not apply to {{mono|a.example.com}}. In addition, each protocol and port needs its own robots.txt file; {{mono|<nowiki>http://example.com/robots.txt</nowiki>}} does not apply to pages under {{mono|<nowiki>http://example.com:8080/</nowiki>}} or {{mono|<nowiki>https://example.com/</nowiki>}}. | A robots.txt file covers one ]. For websites with multiple subdomains, each subdomain must have its own robots.txt file. If {{mono|example.com}} had a robots.txt file but {{mono|a.example.com}} did not, the rules that would apply for {{mono|example.com}} would not apply to {{mono|a.example.com}}. In addition, each protocol and port needs its own robots.txt file; {{mono|<nowiki>http://example.com/robots.txt</nowiki>}} does not apply to pages under {{mono|<nowiki>http://example.com:8080/</nowiki>}} or {{mono|<nowiki>https://example.com/</nowiki>}}. | ||
==Compliance== | |||
⚫ | Some major search ] following this standard include Ask,<ref name="ask-webmasters">{{cite web |title=About Ask.com: Webmasters |url=http://about.ask.com/docs/about/webmasters.shtml|website=About.ask.com |access-date=16 February 2013}}</ref> AOL,<ref name="about-aol-search">{{cite web |title=About AOL Search |url=http://search.aol.com/aol/about|website=Search.aol.com |access-date=16 February 2013}}</ref> Baidu,<ref name="baidu-spider">{{cite web |title=Baiduspider |url=http://www.baidu.com/search/spider_english.html|website=Baidu.com |access-date=16 February 2013}}</ref> DuckDuckGo,<ref name="duckduckgo-bot">{{cite web|url=https://duckduckgo.com/duckduckbot|website=DuckDuckGo.com|title=DuckDuckGo Bot|access-date=25 April 2017}}</ref> Google,<ref name="google-webmasters-spec">{{cite web |url=https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt |title=Webmasters: Robots.txt Specifications |work=Google Developers |access-date=16 February 2013 |archive-url=https://web.archive.org/web/20130115214137/https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt |archive-date=2013-01-15 |url-status=live }}</ref> Yahoo!,<ref name="yahoo-search-is-bing">{{cite web |url=http://help.yahoo.com/kb/index?page=content&y=PROD_SRCH&locale=en_US&id=SLN2217&impressions=true |title=Submitting your website to Yahoo! Search |access-date=16 February 2013 |archive-url=https://web.archive.org/web/20130121035801/http://help.yahoo.com/kb/index?page=content&y=PROD_SRCH&locale=en_US&id=SLN2217&impressions=true |archive-date=2013-01-21 |url-status=live }}</ref> and Yandex.<ref name="yandex-robots">{{cite web |url=http://help.yandex.com/webmaster/?id=1113851 |title=Using robots.txt |website=Help.yandex.com |access-date=16 February 2013 |archive-url=https://web.archive.org/web/20130125040017/http://help.yandex.com/webmaster/?id=1113851 |archive-date=2013-01-25 |url-status=live |
||
The robots.txt protocol is widely complied with by bot operators.<ref name="Verge"/> <!--It entered the court as part of '']'',<ref name=":1">{{Cite news |last= |first= |date=2000-07-31 |title=EBay Fights Spiders on the Web |url=https://www.wired.com/2000/07/ebay-fights-spiders-on-the-web/ |access-date=2024-08-02 |work=] |language=en-US |issn=1059-1028}}</ref> where eBay attempted to block a bot, and the company operating the crawler was ordered to stop crawling eBay's servers using any automatic means, by ] the basis of ].<ref name="case">{{cite court|litigants=eBay v. Bidder's Edge|vol=100|reporter=F. Supp. 2d|opinion=1058|pinpoint=|court=]|date=2000|quote=|url=http://www.cand.uscourts.gov/cand/tentrule.nsf/3979517dd11390ce8825690a007c1b9e/d0fc1406324de0cd882568e90081ebf4/$FILE/Ebay.pdf|archive-url=https://web.archive.org/web/20000817173849/http://www.cand.uscourts.gov/cand/tentrule.nsf/3979517dd11390ce8825690a007c1b9e/d0fc1406324de0cd882568e90081ebf4/$FILE/Ebay.pdf|url-status=dead|accessdate=2000-08-17}}</ref><ref>{{Cite web |last=Hoffmann |first=Jay |date=2020-09-15 |title=Chapter 4: Search |url=https://thehistoryoftheweb.com/book/search/ |access-date=2024-08-02 |website=The History of the Web |language=en-US}}</ref><ref name=":1" />--> | |||
===Search engines=== | |||
⚫ | Some major search ] following this standard include Ask,<ref name="ask-webmasters">{{cite web |title=About Ask.com: Webmasters |url=http://about.ask.com/docs/about/webmasters.shtml |website=About.ask.com |access-date=16 February 2013 |archive-date=27 January 2013 |archive-url=https://web.archive.org/web/20130127134025/http://about.ask.com/docs/about/webmasters.shtml |url-status=live }}</ref> AOL,<ref name="about-aol-search">{{cite web |title=About AOL Search |url=http://search.aol.com/aol/about |website=Search.aol.com |access-date=16 February 2013 |archive-date=13 December 2012 |archive-url=https://web.archive.org/web/20121213134546/http://search.aol.com/aol/about |url-status=dead }}</ref> Baidu,<ref name="baidu-spider">{{cite web |title=Baiduspider |url=http://www.baidu.com/search/spider_english.html |website=Baidu.com |access-date=16 February 2013 |archive-date=6 August 2013 |archive-url=https://web.archive.org/web/20130806131031/http://www.baidu.com/search/spider_english.html |url-status=live }}</ref> Bing,<ref name="bing-blog-robots">{{cite web|url=https://blogs.bing.com/webmaster/2008/06/03/robots-exclusion-protocol-joining-together-to-provide-better-documentation/|title=Robots Exclusion Protocol: joining together to provide better documentation|website=Blogs.bing.com|date=3 June 2008 |archive-url=https://web.archive.org/web/20140818025412/http://blogs.bing.com/webmaster/2008/06/03/robots-exclusion-protocol-joining-together-to-provide-better-documentation/|archive-date=2014-08-18|url-status=live|access-date=16 February 2013}}</ref> DuckDuckGo,<ref name="duckduckgo-bot">{{cite web|url=https://duckduckgo.com/duckduckbot|website=DuckDuckGo.com|title=DuckDuckGo Bot|access-date=25 April 2017|archive-date=16 February 2017|archive-url=https://web.archive.org/web/20170216043103/https://duckduckgo.com/duckduckbot|url-status=live}}</ref> Kagi,<ref name="KagiBot">{{cite web|url=https://kagi.com/bot|website=Kagi Search|title=Kagi Search KagiBot|access-date=20 November 2024|archive-date=12 April 2024|archive-url=https://web.archive.org/web/20240412192855/https://kagi.com/bot|url-status=live}}</ref> Google,<ref name="google-webmasters-spec">{{cite web |url=https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt |title=Webmasters: Robots.txt Specifications |work=Google Developers |access-date=16 February 2013 |archive-url=https://web.archive.org/web/20130115214137/https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt |archive-date=2013-01-15 |url-status=live }}</ref> Yahoo!,<ref name="yahoo-search-is-bing">{{cite web |url=http://help.yahoo.com/kb/index?page=content&y=PROD_SRCH&locale=en_US&id=SLN2217&impressions=true |title=Submitting your website to Yahoo! Search |access-date=16 February 2013 |archive-url=https://web.archive.org/web/20130121035801/http://help.yahoo.com/kb/index?page=content&y=PROD_SRCH&locale=en_US&id=SLN2217&impressions=true |archive-date=2013-01-21 |url-status=live }}</ref> and Yandex.<ref name="yandex-robots">{{cite web |url=http://help.yandex.com/webmaster/?id=1113851 |title=Using robots.txt |website=Help.yandex.com |access-date=16 February 2013 |archive-url=https://web.archive.org/web/20130125040017/http://help.yandex.com/webmaster/?id=1113851 |archive-date=2013-01-25 |url-status=live }}</ref> | ||
===Archival sites=== | |||
⚫ | Some web archiving projects ignore robots.txt. ] uses the file to discover more links, such as ]s.<ref>{{cite web |title=ArchiveBot: Bad behavior |url=https://wiki.archiveteam.org/index.php/ArchiveBot#Bad_behavior |website=wiki.archiveteam.org |publisher=Archive Team |access-date=10 October 2022 |archive-date=10 October 2022 |archive-url=https://web.archive.org/web/20221010034711/https://wiki.archiveteam.org/index.php/ArchiveBot#Bad_behavior |url-status=live }}</ref> Co-founder ] 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>{{cite web|url=http://www.archiveteam.org/index.php?title=Robots.txt|publisher=Archive Team|title=Robots.txt is a suicide note|author=Jason Scott|access-date=18 February 2017|archive-url=https://web.archive.org/web/20170218044527/http://www.archiveteam.org/index.php?title=Robots.txt|archive-date=2017-02-18|url-status=live|author-link=Jason Scott}}</ref> In 2017, the ] announced that it would stop complying with robots.txt directives.<ref>{{Cite web|url=https://blog.archive.org/2017/04/17/robots-txt-meant-for-search-engines-dont-work-well-for-web-archives/|title=Robots.txt meant for search engines don't work well for web archives {{!}} Internet Archive Blogs|website=blog.archive.org|date=17 April 2017|language=en-US|access-date=2018-12-01|archive-url=https://web.archive.org/web/20181204130028/http://blog.archive.org/2017/04/17/robots-txt-meant-for-search-engines-dont-work-well-for-web-archives/|archive-date=2018-12-04|url-status=live}}</ref><ref name="Verge"/> According to '']'', this followed widespread use of robots.txt to remove historical sites from search engine results, and contrasted with the nonprofit's aim to archive "snapshots" of the internet as it previously existed.<ref name="Internet Archive">{{cite news |url=https://www.digitaltrends.com/computing/internet-archive-robots-txt/#ixzz4gQYOqpUi |title=The Internet Archive Will Ignore Robots.txt Files to Maintain Accuracy |newspaper=] |first=Brad |last=Jones |date=24 April 2017 |access-date=8 May 2017 |archive-url=https://web.archive.org/web/20170516130029/https://www.digitaltrends.com/computing/internet-archive-robots-txt/#ixzz4gQYOqpUi |archive-date=2017-05-16 |url-status=live }}</ref> | ||
===Artificial intelligence=== | |||
The volunteering group ] explicitly ignores robots.txt directives, using it instead for discovering more links, such as ]s.<ref>{{cite web |title=ArchiveBot: Bad behavior |url=https://wiki.archiveteam.org/index.php/ArchiveBot#Bad_behavior |website=wiki.archiveteam.org |publisher=Archive Team |access-date=10 October 2022}}</ref> The group views it as an obsolete standard that hinders web archival efforts. According to project leader Jason Scott, "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>{{cite web|url=http://www.archiveteam.org/index.php?title=Robots.txt|publisher=Archive Team|title=Robots.txt is a suicide note|author=Jason Scott|access-date=18 February 2017|archive-url=https://web.archive.org/web/20170218044527/http://www.archiveteam.org/index.php?title=Robots.txt|archive-date=2017-02-18|url-status=live|author-link=Jason Scott}}</ref> | |||
Starting in the 2020s, web operators began using robots.txt to deny access to bots collecting training data for ]. In 2023, Originality.AI found that 306 of the thousand most-visited websites blocked ]'s GPTBot in their robots.txt file and 85 blocked ]'s Google-Extended. Many robots.txt files named GPTBot as the only bot explicitly disallowed on all pages. Denying access to GPTBot was common among news websites such as the ] and '']''. In 2023, blog host ] announced it would deny access to all artificial intelligence web crawlers as "AI companies have leached value from writers in order to spam Internet readers".<ref name="Verge"/> | |||
GPTBot complies with the robots.txt standard and gives advice to web operators about how to disallow it, but '']''{{'}}s David Pierce said this only began after "training the underlying models that made it so powerful". Also, some bots are used both for search engines and artificial intelligence, and it may be impossible to block only one of these options.<ref name="Verge"/> '']'' reported that companies like ] and ] circumvented robots.txt by renaming or spinning up new scrapers to replace the ones that appeared on popular ]s.<ref>{{Cite web |last=Koebler |first=Jason |date=2024-07-29 |title=Websites are Blocking the Wrong AI Scrapers (Because AI Companies Keep Making New Ones) |url=https://www.404media.co/websites-are-blocking-the-wrong-ai-scrapers-because-ai-companies-keep-making-new-ones/ |access-date=2024-07-29 |website=404 Media}}</ref> | |||
⚫ | |||
==Security== | ==Security== | ||
Despite the use of the terms |
Despite the use of the terms ''allow'' and ''disallow'', the protocol is purely advisory and relies on the compliance of the ]; it cannot enforce any of what is stated in the file. <ref>{{cite web |title=Block URLs with robots.txt: Learn about robots.txt files |url=https://support.google.com/webmasters/answer/6062608 |access-date=2015-08-10 |archive-url=https://web.archive.org/web/20150814013400/https://support.google.com/webmasters/answer/6062608 |archive-date=2015-08-14 |url-status=live }}</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>{{cite web |url=https://www.theregister.co.uk/2015/05/19/robotstxt/ |title=Robots.txt tells hackers the places you don't want them to look |work=The Register |access-date=August 12, 2015 |archive-url=https://web.archive.org/web/20150821063759/http://www.theregister.co.uk/2015/05/19/robotstxt/ |archive-date=2015-08-21 |url-status=live }}</ref> this sort of '']'' is discouraged by standards bodies. The ] (NIST) in the United States specifically recommends against this practice: "System security should not depend on the secrecy of the implementation or its components."<ref>{{cite journal |last1=Scarfone |first1=K. A. |last2=Jansen |first2=W. |last3=Tracy |first3=M. |date=July 2008 |title=Guide to General Server Security |url=http://csrc.nist.gov/publications/nistpubs/800-123/SP800-123.pdf |url-status=live |journal=National Institute of Standards and Technology |doi=10.6028/NIST.SP.800-123 |archive-url=https://web.archive.org/web/20111008115412/http://csrc.nist.gov/publications/nistpubs/800-123/SP800-123.pdf |archive-date=2011-10-08 |access-date=August 12, 2015}}</ref> In the context of robots.txt files, security through obscurity is not recommended as a security technique.<ref>{{cite book |author=Sverre H. Huseby |title=Innocent Code: A Security Wake-Up Call for Web Programmers |publisher=John Wiley & Sons |year=2004 |pages=91–92 |isbn=9780470857472 |url=https://books.google.com/books?id=RjVjgPQsKogC&pg=PA92 |access-date=2015-08-12 |archive-url=https://web.archive.org/web/20160401193437/https://books.google.com/books?id=RjVjgPQsKogC&pg=PA92 |archive-date=2016-04-01 |url-status=live }}</ref> | ||
==Alternatives== | ==Alternatives== | ||
Many robots also pass a special ] to the web server when fetching content.<ref>{{cite web |url=http://www.user-agents.org/ |title=List of User-Agents (Spiders, Robots, Browser) |publisher=User-agents.org |access-date=2013-12-29 |archive-url=https://web.archive.org/web/20140107154205/http://user-agents.org/ |archive-date=2014-01-07 |url-status=live }}</ref> A web administrator could also configure the server to automatically return failure (or ]) when it detects a connection using one of the robots.<ref>{{cite web |url=https://httpd.apache.org/docs/2.2/howto/access.html |title=Access Control - Apache HTTP Server |publisher=Httpd.apache.org |access-date=2013-12-29 |archive-url=https://web.archive.org/web/20131229110831/http://httpd.apache.org/docs/2.2/howto/access.html |archive-date=2013-12-29 |url-status=live }}</ref><ref>{{cite web |url=http://www.iis.net/configreference/system.webserver/security/requestfiltering/filteringrules/filteringrule/denystrings |title=Deny Strings for Filtering Rules : The Official Microsoft IIS Site |publisher=Iis.net |date=2013-11-06 |access-date=2013-12-29 |archive-url=https://web.archive.org/web/20140101112730/http://www.iis.net/configreference/system.webserver/security/requestfiltering/filteringrules/filteringrule/denystrings |archive-date=2014-01-01 |url-status=live }}</ref> | Many robots also pass a special ] to the web server when fetching content.<ref>{{cite web |url=http://www.user-agents.org/ |title=List of User-Agents (Spiders, Robots, Browser) |publisher=User-agents.org |access-date=2013-12-29 |archive-url=https://web.archive.org/web/20140107154205/http://user-agents.org/ |archive-date=2014-01-07 |url-status=live }}</ref> A web administrator could also configure the server to automatically return failure (or ]) when it detects a connection using one of the robots.<ref>{{cite web |url=https://httpd.apache.org/docs/2.2/howto/access.html |title=Access Control - Apache HTTP Server |publisher=Httpd.apache.org |access-date=2013-12-29 |archive-url=https://web.archive.org/web/20131229110831/http://httpd.apache.org/docs/2.2/howto/access.html |archive-date=2013-12-29 |url-status=live }}</ref><ref>{{cite web |url=http://www.iis.net/configreference/system.webserver/security/requestfiltering/filteringrules/filteringrule/denystrings |title=Deny Strings for Filtering Rules : The Official Microsoft IIS Site |publisher=Iis.net |date=2013-11-06 |access-date=2013-12-29 |archive-url=https://web.archive.org/web/20140101112730/http://www.iis.net/configreference/system.webserver/security/requestfiltering/filteringrules/filteringrule/denystrings |archive-date=2014-01-01 |url-status=live }}</ref> | ||
Some sites, such as ], host a <code>humans.txt</code> file that displays information meant for humans to read.<ref>{{Cite web |url=https://www.google.com/humans.txt |title=Google humans.txt |access-date=October 3, 2019 }}</ref> Some sites such as ] redirect humans.txt to an |
Some sites, such as ], host a <code>humans.txt</code> file that displays information meant for humans to read.<ref>{{Cite web |url=https://www.google.com/humans.txt |title=Google humans.txt |access-date=October 3, 2019 |archive-date=January 24, 2017 |archive-url=https://web.archive.org/web/20170124121422/https://www.google.com/humans.txt |url-status=live }}</ref> Some sites such as ] redirect humans.txt to an ''About'' page.<ref>{{Cite web |url=https://github.com/humans.txt |title=Github humans.txt |website=] |access-date=October 3, 2019 |archive-date=May 30, 2016 |archive-url=https://web.archive.org/web/20160530160942/https://github.com/humans.txt |url-status=live }}</ref> | ||
Previously, Google had a joke file hosted at <code>/killer-robots.txt</code> instructing ] not to kill the company founders ] and ].<ref>{{Cite web|url=https://slate.com/technology/2014/07/a-killer-robots-txt-google-easter-egg.html|title=Is This a Google Easter Egg or Proof That Skynet Is Actually Plotting World Domination?|last=Newman|first=Lily Hay|date=2014-07-03|website=Slate Magazine|language=en|access-date=2019-10-03}}</ref><ref>{{Cite web|url=https://www.google.com/killer-robots.txt|title=/killer-robots.txt|date=2018-01-10|url-status=dead|archive-url=https://web.archive.org/web/20180110160916/https://www.google.com/killer-robots.txt|archive-date=2018-01-10|access-date=2018-05-25}}</ref> | Previously, Google had a joke file hosted at <code>/killer-robots.txt</code> instructing ] not to kill the company founders ] and ].<ref>{{Cite web|url=https://slate.com/technology/2014/07/a-killer-robots-txt-google-easter-egg.html|title=Is This a Google Easter Egg or Proof That Skynet Is Actually Plotting World Domination?|last=Newman|first=Lily Hay|date=2014-07-03|website=Slate Magazine|language=en|access-date=2019-10-03|archive-date=2018-11-18|archive-url=https://web.archive.org/web/20181118104127/https://slate.com/technology/2014/07/a-killer-robots-txt-google-easter-egg.html|url-status=live}}</ref><ref>{{Cite web|url=https://www.google.com/killer-robots.txt|title=/killer-robots.txt|date=2018-01-10|url-status=dead|archive-url=https://web.archive.org/web/20180110160916/https://www.google.com/killer-robots.txt|archive-date=2018-01-10|access-date=2018-05-25}}</ref> | ||
==Examples== | ==Examples== | ||
Line 50: | Line 92: | ||
Disallow: | Disallow: | ||
</pre> | </pre> | ||
This example has the same effect, allowing all files rather than prohibiting none. | |||
<pre> | <pre> | ||
Line 118: | Line 162: | ||
Disallow: /something/ # disallow this directory | Disallow: /something/ # disallow this directory | ||
</pre> | </pre> | ||
=== Difference Between <code>Disallow: /something/</code> and <code>Disallow: /something/*</code> === | |||
The directive <code>Disallow: /something/</code> blocks all files and subdirectories starting with <code>/something/</code>. In contrast, <code>Disallow: /something/*</code> (if supported by the crawler) blocks URLs with more complex patterns, such as <code>/something-folder/page</code>. The wildcard <code>*</code> allows greater flexibility but may not be recognized by all crawlers. | |||
==Nonstandard extensions== | ==Nonstandard extensions== | ||
===Crawl-delay directive=== | ===Crawl-delay directive=== | ||
The 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.<ref name="yandex-robots"/> 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 name="bing-crawl-delay">{{cite web |url=https://blogs.bing.com/webmaster/2012/05/03/to-crawl-or-not-to-crawl-that-is-bingbots-question/ |title=To crawl or not to crawl, that is BingBot's question |date=3 May 2012 |access-date=9 February 2016 |archive-url=https://web.archive.org/web/20160203142822/https://blogs.bing.com/webmaster/2012/05/03/to-crawl-or-not-to-crawl-that-is-bingbots-question/ |archive-date=2016-02-03 |url-status=live }}</ref> Google provides an interface in its ] for webmasters, to control the ]'s subsequent visits.<ref>{{cite web |title=Change Googlebot crawl rate - Search Console Help |url=https://support.google.com/webmasters/answer/48620?hl=en |website=support.google.com |access-date=22 October 2018 |language=en |archive-url=https://web.archive.org/web/20181118205747/https://support.google.com/webmasters/answer/48620?hl=en |archive-date=2018-11-18 |url-status=live }}</ref> | The 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.<ref name="yandex-robots"/> 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 name="bing-crawl-delay">{{cite web |url=https://blogs.bing.com/webmaster/2012/05/03/to-crawl-or-not-to-crawl-that-is-bingbots-question/ |title=To crawl or not to crawl, that is BingBot's question |date=3 May 2012 |access-date=9 February 2016 |archive-url=https://web.archive.org/web/20160203142822/https://blogs.bing.com/webmaster/2012/05/03/to-crawl-or-not-to-crawl-that-is-bingbots-question/ |archive-date=2016-02-03 |url-status=live }}</ref> Google ignores this directive,<ref>{{cite web |title=How Google interprets the robots.txt specification |url=https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt |website=Google Search Central |access-date=2024-10-06 |date=2024-05-23}}</ref> but provides an interface in its ] for webmasters, to control the ]'s subsequent visits.<ref>{{cite web |title=Change Googlebot crawl rate - Search Console Help |url=https://support.google.com/webmasters/answer/48620?hl=en |website=support.google.com |access-date=22 October 2018 |language=en |archive-url=https://web.archive.org/web/20181118205747/https://support.google.com/webmasters/answer/48620?hl=en |archive-date=2018-11-18 |url-status=live }}</ref> | ||
<pre> | <pre> | ||
Line 133: | Line 180: | ||
Some crawlers support a <code>Sitemap</code> directive, allowing multiple ] in the same <samp>robots.txt</samp> in the form <code>Sitemap: ''full-url''</code>:<ref>{{cite web |url=http://ysearchblog.com/2007/04/11/webmasters-can-now-auto-discover-with-sitemaps/ |title=Yahoo! Search Blog - Webmasters can now auto-discover with Sitemaps |access-date=2009-03-23 |archive-url=https://web.archive.org/web/20090305061841/http://ysearchblog.com/2007/04/11/webmasters-can-now-auto-discover-with-sitemaps/ |archive-date=2009-03-05 |url-status=dead }}</ref> | Some crawlers support a <code>Sitemap</code> directive, allowing multiple ] in the same <samp>robots.txt</samp> in the form <code>Sitemap: ''full-url''</code>:<ref>{{cite web |url=http://ysearchblog.com/2007/04/11/webmasters-can-now-auto-discover-with-sitemaps/ |title=Yahoo! Search Blog - Webmasters can now auto-discover with Sitemaps |access-date=2009-03-23 |archive-url=https://web.archive.org/web/20090305061841/http://ysearchblog.com/2007/04/11/webmasters-can-now-auto-discover-with-sitemaps/ |archive-date=2009-03-05 |url-status=dead }}</ref> | ||
<pre>Sitemap: http://www.example.com/sitemap.xml</pre> | <pre>Sitemap: http://www.example.com/sitemap.xml</pre> | ||
===Host=== | |||
Some crawlers (]) support a <code>Host</code> directive, allowing websites with multiple mirrors to specify their preferred domain:<ref>{{cite web |url=http://help.yandex.com/webmaster/?id=1113851 |title=Yandex - Using robots.txt |access-date=2013-05-13 |archive-url=https://web.archive.org/web/20130509230548/http://help.yandex.com/webmaster/?id=1113851 |archive-date=2013-05-09 |url-status=live }}</ref> | |||
<pre> | |||
Host: hosting.example.com | |||
</pre> | |||
This is not supported by all crawlers. | |||
===Universal "*" match=== | ===Universal "*" match=== | ||
The ''Robot Exclusion Standard'' does not mention the "*" character in the <code>Disallow:</code> statement.<ref>{{cite web |url=https://developers.google.com/search/reference/robots_txt?hl=en |title=Robots.txt Specifications |website=Google Developers |access-date=February 15, 2020}}</ref><!-- Please note that Google updated their code to match the standard on On July 1, 2019. References older than that may contain old, obsolete information about how Google behaves --> | The ''Robot Exclusion Standard'' does not mention the "*" character in the <code>Disallow:</code> statement.<ref>{{cite web |url=https://developers.google.com/search/reference/robots_txt?hl=en |title=Robots.txt Specifications |website=Google Developers |access-date=February 15, 2020 |archive-date=November 2, 2019 |archive-url=https://web.archive.org/web/20191102192623/https://developers.google.com/search/reference/robots_txt?hl=en |url-status=live }}</ref><!-- Please note that Google updated their code to match the standard on On July 1, 2019. References older than that may contain old, obsolete information about how Google behaves --> | ||
==Meta tags and headers== | ==Meta tags and headers== | ||
In addition to root-level robots.txt files, robots exclusion directives can be applied at a more granular level through the use of ]s 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 ] and ] files.<ref name="google-meta">{{cite web |url=https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag |title=Robots meta tag and X-Robots-Tag HTTP header specifications - Webmasters — Google Developers |access-date=2013-08-17 |archive-url=https://web.archive.org/web/20130808020946/https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag |archive-date=2013-08-08 |url-status=live }}</ref> | In addition to root-level robots.txt files, robots exclusion directives can be applied at a more granular level through the use of ]s 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 ] and ] files.<ref name="google-meta">{{cite web |url=https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag |title=Robots meta tag and X-Robots-Tag HTTP header specifications - Webmasters — Google Developers |access-date=2013-08-17 |archive-url=https://web.archive.org/web/20130808020946/https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag |archive-date=2013-08-08 |url-status=live }}</ref> | ||
===A "noindex" meta tag=== | |||
<syntaxhighlight lang="html"> | <syntaxhighlight lang="html"> | ||
<meta name="robots" content="noindex" /> | <meta name="robots" content="noindex" /> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===A "noindex" HTTP response header=== | |||
<syntaxhighlight lang="html"> | <syntaxhighlight lang="html"> | ||
X-Robots-Tag: noindex | X-Robots-Tag: noindex | ||
Line 163: | Line 199: | ||
The 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.<ref name="google-meta"/> | The 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.<ref name="google-meta"/> | ||
⚫ | ===Maximum size of a robots.txt file=== | ||
⚫ | The Robots Exclusion Protocol requires crawlers to parse at least 500 kibibytes (512000 bytes) of robots.txt files,{{Ref RFC|9309|section=2.5: Limits}} which Google maintains as a 500 kibibyte file size restriction for robots.txt files.<ref>{{Cite web |title=How Google Interprets the robots.txt Specification {{!}} Documentation |url=https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt |access-date=2022-10-17 |website=Google Developers |language=en |archive-date=2022-10-17 |archive-url=https://web.archive.org/web/20221017101925/https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt |url-status=live }}</ref> | ||
⚫ | |||
⚫ | The Robots Exclusion Protocol requires crawlers to parse at least 500 kibibytes ( |
||
==See also== | ==See also== | ||
⚫ | {{Portal|Internet}} | ||
{{ |
{{Div col|colwidth=30em}} | ||
* <code>]</code>, a standard for listing authorized ad sellers | * <code>]</code>, a standard for listing authorized ad sellers | ||
* <code>]</code>, a file to describe the process for security researchers to follow in order to report security vulnerabilities | * <code>]</code>, a file to describe the process for security researchers to follow in order to report security vulnerabilities | ||
* ] – |
* ] | ||
* ] – A failed proposal to extend robots.txt | |||
* ] – |
* ] – Now inactive search engine for robots.txt files | ||
* ] | * ] | ||
* ] | * ] | ||
* ] | * ] | ||
⚫ | * ] for search engines | ||
* ] (NDLP) | * ] (NDLP) | ||
* ] (NDIIPP) | * ] (NDIIPP) | ||
* ] | * ] | ||
⚫ | * ] | ||
* ] | * ] | ||
⚫ | * ] for search engines | ||
* ] | * ] | ||
* ] | * ] | ||
* ] | * ] | ||
* ] | * ] | ||
⚫ | {{Div col end}} | ||
⚫ | * ] | ||
⚫ | {{ |
||
==References== | ==References== | ||
{{Reflist|30em}} | {{Reflist|30em}} | ||
== Further reading == | |||
* {{Cite web |last=Allyn |first=Bobby |date=5 July 2024 |title=Artificial Intelligence Web Crawlers Are Running Amok |url=https://www.npr.org/2024/07/05/nx-s1-5026932/artificial-intelligence-web-crawlers-are-running-amok |url-status=live |archive-url=https://web.archive.org/web/20240706063210/https://www.npr.org/2024/07/05/nx-s1-5026932/artificial-intelligence-web-crawlers-are-running-amok |archive-date=6 July 2024 |work=] |publisher=] |access-date=6 July 2024}} | |||
==External links== | ==External links== | ||
Line 201: | Line 240: | ||
*============================ {{No more links}} ============================+ | *============================ {{No more links}} ============================+ | ||
--> | --> | ||
⚫ | * {{Official website|https://www.robotstxt.org}} | ||
⚫ | * {{Official website| |
||
⚫ | {{Portal |
||
{{Authority control}} | {{Authority control}} | ||
{{DEFAULTSORT:Robots Exclusion Standard}} | {{DEFAULTSORT:Robots Exclusion Standard}} | ||
] | ] | ||
] | |||
] | |||
] |
Latest revision as of 08:31, 28 December 2024
Filename used to indicate portions for web crawling For Misplaced Pages's robots.txt file, see https://en.wikipedia.org/robots.txt.
Robots Exclusion Protocol | |
Example of a simple robots.txt file, indicating that a user-agent called "Mallorybot" is not allowed to crawl any of the website's pages, and that other user-agents cannot crawl more than one page every 20 seconds, and are not allowed to crawl the "secret" folder | |
Status | Proposed Standard |
---|---|
First published | 1994 published, formally standardized in 2022 |
Authors |
|
Website | robotstxt |
robots.txt is the filename used for implementing the Robots Exclusion Protocol, a standard used by websites to indicate to visiting web crawlers and other web robots which portions of the website they are allowed to visit.
The standard, developed in 1994, relies on voluntary compliance. Malicious bots can use the file as a directory of which pages to visit, though standards bodies discourage countering this with security through obscurity. Some archival sites ignore robots.txt. The standard was used in the 1990s to mitigate server overload. In the 2020s, websites began denying bots that collect information for generative artificial intelligence.
The "robots.txt" file can be used in conjunction with sitemaps, another robot inclusion standard for websites.
History
The standard was proposed by Martijn Koster, when working for Nexor in February 1994 on the www-talk mailing list, the main communication channel for WWW-related activities at the time. Charles Stross claims to have provoked Koster to suggest robots.txt, after he wrote a badly behaved web crawler that inadvertently caused a denial-of-service attack on Koster's server.
The standard, initially RobotsNotWanted.txt, allowed web developers to specify which bots should not access their website or which pages bots should not access. The internet was small enough in 1994 to maintain a complete list of all bots; server overload was a primary concern. By June 1994 it had become a de facto standard; most complied, including those operated by search engines such as WebCrawler, Lycos, and AltaVista.
On July 1, 2019, Google announced the proposal of the Robots Exclusion Protocol as an official standard under Internet Engineering Task Force. A proposed standard was published in September 2022 as RFC 9309.
Standard
When a site owner wishes to give instructions to web robots they place a text file called robots.txt in the root of the web site hierarchy (e.g. https://www.example.com/robots.txt). 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 the website. If this file does not exist, web robots assume that the website owner does not wish to place any limitations on crawling the entire site.
A robots.txt file contains instructions for bots indicating which web pages they can and cannot access. Robots.txt files are particularly important for web crawlers from search engines such as Google.
A robots.txt file on a website will function as a request that specified robots ignore specified files or directories when crawling a site. This might be, for example, out of a preference for privacy from search engine results, or the belief that the content of the selected directories might be misleading or irrelevant to the categorization of the site as a whole, or out of a desire that an application only operates on certain data. Links to pages listed in robots.txt can still appear in search results if they are linked to from a page that is crawled.
A robots.txt file covers one origin. For websites with multiple subdomains, each subdomain must have its own robots.txt file. If example.com had a robots.txt file but a.example.com did not, the rules that would apply for example.com would not apply to a.example.com. In addition, each protocol and port needs its own robots.txt file; http://example.com/robots.txt does not apply to pages under http://example.com:8080/ or https://example.com/.
Compliance
The robots.txt protocol is widely complied with by bot operators.
Search engines
Some major search engines following this standard include Ask, AOL, Baidu, Bing, DuckDuckGo, Kagi, Google, Yahoo!, and Yandex.
Archival sites
Some web archiving projects ignore robots.txt. Archive Team uses the file to discover more links, such as sitemaps. 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." In 2017, the Internet Archive announced that it would stop complying with robots.txt directives. According to Digital Trends, this followed widespread use of robots.txt to remove historical sites from search engine results, and contrasted with the nonprofit's aim to archive "snapshots" of the internet as it previously existed.
Artificial intelligence
Starting in the 2020s, web operators began using robots.txt to deny access to bots collecting training data for generative AI. In 2023, Originality.AI found that 306 of the thousand most-visited websites blocked OpenAI's GPTBot in their robots.txt file and 85 blocked Google's Google-Extended. Many robots.txt files named GPTBot as the only bot explicitly disallowed on all pages. Denying access to GPTBot was common among news websites such as the BBC and The New York Times. In 2023, blog host Medium announced it would deny access to all artificial intelligence web crawlers as "AI companies have leached value from writers in order to spam Internet readers".
GPTBot complies with the robots.txt standard and gives advice to web operators about how to disallow it, but The Verge's David Pierce said this only began after "training the underlying models that made it so powerful". Also, some bots are used both for search engines and artificial intelligence, and it may be impossible to block only one of these options. 404 Media reported that companies like Anthropic and Perplexity.ai circumvented robots.txt by renaming or spinning up new scrapers to replace the ones that appeared on popular blocklists.
Security
Despite 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. 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, this sort of security through obscurity is discouraged by standards bodies. The National Institute of Standards and Technology (NIST) in the United States specifically recommends against this practice: "System security should not depend on the secrecy of the implementation or its components." In the context of robots.txt files, security through obscurity is not recommended as a security technique.
Alternatives
Many robots also pass a special user-agent to the web server when fetching content. A web administrator could also configure the server to automatically return failure (or pass alternative content) when it detects a connection using one of the robots.
Some sites, such as Google, host a humans.txt
file that displays information meant for humans to read. Some sites such as GitHub redirect humans.txt to an About page.
Previously, Google had a joke file hosted at /killer-robots.txt
instructing the Terminator not to kill the company founders Larry Page and Sergey Brin.
Examples
This example tells all robots that they can visit all files because the wildcard *
stands for all robots and the Disallow
directive has no value, meaning no pages are disallowed.
User-agent: * Disallow:
This example has the same effect, allowing all files rather than prohibiting none.
User-agent: * Allow: /
The same result can be accomplished with an empty or missing robots.txt file.
This example tells all robots to stay out of a website:
User-agent: * Disallow: /
This example tells all robots not to enter three directories:
User-agent: * Disallow: /cgi-bin/ Disallow: /tmp/ Disallow: /junk/
This example tells all robots to stay away from one specific file:
User-agent: * Disallow: /directory/file.html
All other files in the specified directory will be processed.
User-agent: BadBot # replace 'BadBot' with the actual user-agent of the bot Disallow: /
This example tells two specific robots not to enter one specific directory:
User-agent: BadBot # replace 'BadBot' with the actual user-agent of the bot User-agent: Googlebot 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
It 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, support several user-agent strings that allow the operator to deny access to a subset of their services by using specific user-agent strings.
Example demonstrating multiple user-agents:
User-agent: googlebot # all Google services Disallow: /private/ # disallow this directory User-agent: googlebot-news # only the news service Disallow: / # disallow everything User-agent: * # any robot Disallow: /something/ # disallow this directory
Difference Between Disallow: /something/
and Disallow: /something/*
The directive Disallow: /something/
blocks all files and subdirectories starting with /something/
. In contrast, Disallow: /something/*
(if supported by the crawler) blocks URLs with more complex patterns, such as /something-folder/page
. The wildcard *
allows greater flexibility but may not be recognized by all crawlers.
Nonstandard extensions
Crawl-delay directive
The 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. Google ignores this directive, but provides an interface in its search console for webmasters, to control the Googlebot's subsequent visits.
User-agent: bingbot Allow: / Crawl-delay: 10
Sitemap
Some crawlers support a Sitemap
directive, allowing multiple Sitemaps in the same robots.txt in the form Sitemap: full-url
:
Sitemap: http://www.example.com/sitemap.xml
Universal "*" match
The Robot Exclusion Standard does not mention the "*" character in the Disallow:
statement.
Meta tags and headers
In 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 httpd.conf files.
A "noindex" meta tag
<meta name="robots" content="noindex" />
A "noindex" HTTP response header
X-Robots-Tag: noindex
The 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.
Maximum size of a robots.txt file
The 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.
See also
ads.txt
, a standard for listing authorized ad sellerssecurity.txt
, a file to describe the process for security researchers to follow in order to report security vulnerabilities- eBay v. Bidder's Edge
- Automated Content Access Protocol – A failed proposal to extend robots.txt
- BotSeer – Now inactive search engine for robots.txt files
- Distributed web crawling
- Focused crawler
- Internet Archive
- Meta elements for search engines
- National Digital Library Program (NDLP)
- National Digital Information Infrastructure and Preservation Program (NDIIPP)
- nofollow
- noindex
- Perma.cc
- Sitemaps
- Spider trap
- Web archiving
- Web crawler
References
- "Historical". Greenhills.co.uk. Archived from the original on 2017-04-03. Retrieved 2017-03-03.
- Fielding, Roy (1994). "Maintaining Distributed Hypertext Infostructures: Welcome to MOMspider's Web" (PostScript). First International Conference on the World Wide Web. Geneva. Archived from the original on 2013-09-27. Retrieved September 25, 2013.
- "The Web Robots Pages". Robotstxt.org. 1994-06-30. Archived from the original on 2014-01-12. Retrieved 2013-12-29.
- Koster, Martijn (25 February 1994). "Important: Spiders, Robots and Web Wanderers". www-talk mailing list. Archived from the original (Hypermail archived message) on October 29, 2013.
- "How I got here in the end, part five: "things can only get better!"". Charlie's Diary. 19 June 2006. Archived from the original on 2013-11-25. Retrieved 19 April 2014.
- ^ Pierce, David (14 February 2024). "The text file that runs the internet". The Verge. Retrieved 16 March 2024.
- Barry Schwartz (30 June 2014). "Robots.txt Celebrates 20 Years Of Blocking Search Engines". Search Engine Land. Archived from the original on 2015-09-07. Retrieved 2015-11-19.
- "Formalizing the Robots Exclusion Protocol Specification". Official Google Webmaster Central Blog. Archived from the original on 2019-07-10. Retrieved 2019-07-10.
- Koster, M.; Illyes, G.; Zeller, H.; Sassman, L. (September 2022). Robots Exclusion Protocol. Internet Engineering Task Force. doi:10.17487/RFC9309. RFC 9309. Proposed Standard.
- "Uncrawled URLs in search results". YouTube. Oct 5, 2009. Archived from the original on 2014-01-06. Retrieved 2013-12-29.
- "About Ask.com: Webmasters". About.ask.com. Archived from the original on 27 January 2013. Retrieved 16 February 2013.
- "About AOL Search". Search.aol.com. Archived from the original on 13 December 2012. Retrieved 16 February 2013.
- "Baiduspider". Baidu.com. Archived from the original on 6 August 2013. Retrieved 16 February 2013.
- "Robots Exclusion Protocol: joining together to provide better documentation". Blogs.bing.com. 3 June 2008. Archived from the original on 2014-08-18. Retrieved 16 February 2013.
- "DuckDuckGo Bot". DuckDuckGo.com. Archived from the original on 16 February 2017. Retrieved 25 April 2017.
- "Kagi Search KagiBot". Kagi Search. Archived from the original on 12 April 2024. Retrieved 20 November 2024.
- ^ "Webmasters: Robots.txt Specifications". Google Developers. Archived from the original on 2013-01-15. Retrieved 16 February 2013.
- "Submitting your website to Yahoo! Search". Archived from the original on 2013-01-21. Retrieved 16 February 2013.
- ^ "Using robots.txt". Help.yandex.com. Archived from the original on 2013-01-25. Retrieved 16 February 2013.
- "ArchiveBot: Bad behavior". wiki.archiveteam.org. Archive Team. Archived from the original on 10 October 2022. Retrieved 10 October 2022.
- Jason Scott. "Robots.txt is a suicide note". Archive Team. Archived from the original on 2017-02-18. Retrieved 18 February 2017.
- "Robots.txt meant for search engines don't work well for web archives | Internet Archive Blogs". blog.archive.org. 17 April 2017. Archived from the original on 2018-12-04. Retrieved 2018-12-01.
- Jones, Brad (24 April 2017). "The Internet Archive Will Ignore Robots.txt Files to Maintain Accuracy". Digital Trends. Archived from the original on 2017-05-16. Retrieved 8 May 2017.
- Koebler, Jason (2024-07-29). "Websites are Blocking the Wrong AI Scrapers (Because AI Companies Keep Making New Ones)". 404 Media. Retrieved 2024-07-29.
- "Block URLs with robots.txt: Learn about robots.txt files". Archived from the original on 2015-08-14. Retrieved 2015-08-10.
- "Robots.txt tells hackers the places you don't want them to look". The Register. Archived from the original on 2015-08-21. Retrieved August 12, 2015.
- Scarfone, K. A.; Jansen, W.; Tracy, M. (July 2008). "Guide to General Server Security" (PDF). National Institute of Standards and Technology. doi:10.6028/NIST.SP.800-123. Archived (PDF) from the original on 2011-10-08. Retrieved August 12, 2015.
- Sverre H. Huseby (2004). Innocent Code: A Security Wake-Up Call for Web Programmers. John Wiley & Sons. pp. 91–92. ISBN 9780470857472. Archived from the original on 2016-04-01. Retrieved 2015-08-12.
- "List of User-Agents (Spiders, Robots, Browser)". User-agents.org. Archived from the original on 2014-01-07. Retrieved 2013-12-29.
- "Access Control - Apache HTTP Server". Httpd.apache.org. Archived from the original on 2013-12-29. Retrieved 2013-12-29.
- "Deny Strings for Filtering Rules : The Official Microsoft IIS Site". Iis.net. 2013-11-06. Archived from the original on 2014-01-01. Retrieved 2013-12-29.
- "Google humans.txt". Archived from the original on January 24, 2017. Retrieved October 3, 2019.
- "Github humans.txt". GitHub. Archived from the original on May 30, 2016. Retrieved October 3, 2019.
- Newman, Lily Hay (2014-07-03). "Is This a Google Easter Egg or Proof That Skynet Is Actually Plotting World Domination?". Slate Magazine. Archived from the original on 2018-11-18. Retrieved 2019-10-03.
- "/killer-robots.txt". 2018-01-10. Archived from the original on 2018-01-10. Retrieved 2018-05-25.
- "To crawl or not to crawl, that is BingBot's question". 3 May 2012. Archived from the original on 2016-02-03. Retrieved 9 February 2016.
- "How Google interprets the robots.txt specification". Google Search Central. 2024-05-23. Retrieved 2024-10-06.
- "Change Googlebot crawl rate - Search Console Help". support.google.com. Archived from the original on 2018-11-18. Retrieved 22 October 2018.
- "Yahoo! Search Blog - Webmasters can now auto-discover with Sitemaps". Archived from the original on 2009-03-05. Retrieved 2009-03-23.
- "Robots.txt Specifications". Google Developers. Archived from the original on November 2, 2019. Retrieved February 15, 2020.
- ^ "Robots meta tag and X-Robots-Tag HTTP header specifications - Webmasters — Google Developers". Archived from the original on 2013-08-08. Retrieved 2013-08-17.
- Koster, M.; Illyes, G.; Zeller, H.; Sassman, L. (September 2022). Robots Exclusion Protocol. Internet Engineering Task Force. doi:10.17487/RFC9309. RFC 9309. Proposed Standard. sec. 2.5: Limits.
- "How Google Interprets the robots.txt Specification | Documentation". Google Developers. Archived from the original on 2022-10-17. Retrieved 2022-10-17.
Further reading
- Allyn, Bobby (5 July 2024). "Artificial Intelligence Web Crawlers Are Running Amok". All Things Considered. NPR. Archived from the original on 6 July 2024. Retrieved 6 July 2024.