Skip to content

Commit 0fdbbdc

Browse files
authored
docs: serve robots.txt opting V2 docs out of AI training crawls (#6003)
Add a robots.txt at the docs site root that disallows AI training and data-collection crawlers (GPTBot, ClaudeBot, CCBot, Google-Extended, etc.) from the deprecated V2 docs path (/en/v2/). This is the Layer A (training-data) crawl opt-out lever from the V2->V3 version-management strategy, reducing the public V2 corpus fed into future model training. ReadTheDocs serves robots.txt only from the default version at the domain root, so the file must live on this V3/default build; a robots.txt inside the non-default V2 build would land at /en/v2/robots.txt and never be read. Wire it up via html_extra_path so Sphinx copies it into the build root. Generic search bots are intentionally left allowed: robots.txt Disallow and the noindex meta tag are mutually exclusive on the same path, and V2 search de-indexing is handled by noindex + canonical on the V2 build.
1 parent b27221b commit 0fdbbdc

2 files changed

Lines changed: 111 additions & 0 deletions

File tree

‎docs/conf.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@
2626
]
2727

2828
templates_path = ['_templates']
29+
30+
# Serve robots.txt at the docs site root. ReadTheDocs serves robots.txt only from
31+
# the default version, so it must live on this V3/default build (not the V2 build).
32+
# It opts the deprecated V2 docs (/en/v2/) out of AI-training crawls. Sphinx copies
33+
# files listed here verbatim into the build root.
34+
html_extra_path = ['robots.txt']
35+
2936
exclude_patterns = [
3037
'_build',
3138
'Thumbs.db',

‎docs/robots.txt‎

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# robots.txt — served at the docs site root (https://sagemaker.readthedocs.io/robots.txt).
2+
#
3+
# This file MUST live on the DEFAULT ReadTheDocs version (the V3 / master build):
4+
# ReadTheDocs only serves robots.txt from the default version at the domain root.
5+
# A robots.txt shipped inside the non-default V2 build would land at
6+
# /en/v2/robots.txt, which crawlers never read, so it would have no effect.
7+
#
8+
# Purpose: opt the deprecated SageMaker Python SDK V2 docs (/en/v2/) OUT of AI
9+
# training / data-collection crawls. This is an ADVISORY signal: only compliant
10+
# crawlers honor it (well-behaved bots from major AI vendors do; abusive crawlers
11+
# ignore it). It is the crawl opt-out lever.
12+
#
13+
# Search de-indexing of the V2 docs is handled SEPARATELY, on the V2 build, by a
14+
# <meta name="robots" content="noindex"> tag injected on every page plus a
15+
# <link rel="canonical"> pointing at the V3 page. Those are per-page <head> tags
16+
# and live on the V2 branch, not here.
17+
#
18+
# IMPORTANT — do NOT add a "User-agent: * Disallow: /en/v2/" rule:
19+
# robots.txt Disallow and the noindex meta tag are mutually exclusive on the same
20+
# path. A path blocked here is never fetched, so a search crawler would never see
21+
# the page's noindex meta and could keep a bare, snippet-less URL in its index.
22+
# Generic search bots (Googlebot, Bingbot, ...) must stay ALLOWED so they can read
23+
# noindex + canonical and consolidate on V3. Only AI-training/collection crawlers
24+
# are blocked below.
25+
26+
# --- OpenAI ---
27+
User-agent: GPTBot
28+
Disallow: /en/v2/
29+
30+
User-agent: OAI-SearchBot
31+
Disallow: /en/v2/
32+
33+
User-agent: ChatGPT-User
34+
Disallow: /en/v2/
35+
36+
# --- Anthropic ---
37+
User-agent: ClaudeBot
38+
Disallow: /en/v2/
39+
40+
User-agent: anthropic-ai
41+
Disallow: /en/v2/
42+
43+
User-agent: Claude-Web
44+
Disallow: /en/v2/
45+
46+
# --- Google (Gemini / Vertex AI training; distinct from Googlebot search) ---
47+
User-agent: Google-Extended
48+
Disallow: /en/v2/
49+
50+
# --- Common Crawl (open dataset that feeds many LLM training corpora) ---
51+
User-agent: CCBot
52+
Disallow: /en/v2/
53+
54+
# --- Meta (Llama training) ---
55+
User-agent: Meta-ExternalAgent
56+
Disallow: /en/v2/
57+
58+
User-agent: meta-externalagent
59+
Disallow: /en/v2/
60+
61+
User-agent: FacebookBot
62+
Disallow: /en/v2/
63+
64+
# --- Amazon ---
65+
User-agent: Amazonbot
66+
Disallow: /en/v2/
67+
68+
# --- Apple (Apple Intelligence training) ---
69+
User-agent: Applebot-Extended
70+
Disallow: /en/v2/
71+
72+
# --- ByteDance ---
73+
User-agent: Bytespider
74+
Disallow: /en/v2/
75+
76+
# --- Perplexity ---
77+
User-agent: PerplexityBot
78+
Disallow: /en/v2/
79+
80+
# --- Cohere ---
81+
User-agent: cohere-ai
82+
Disallow: /en/v2/
83+
84+
# --- Others (search-adjacent AI answer engines / data collectors) ---
85+
User-agent: Diffbot
86+
Disallow: /en/v2/
87+
88+
User-agent: Omgilibot
89+
Disallow: /en/v2/
90+
91+
User-agent: Omgili
92+
Disallow: /en/v2/
93+
94+
User-agent: YouBot
95+
Disallow: /en/v2/
96+
97+
User-agent: ImagesiftBot
98+
Disallow: /en/v2/
99+
100+
User-agent: PetalBot
101+
Disallow: /en/v2/
102+
103+
User-agent: Timpibot
104+
Disallow: /en/v2/

0 commit comments

Comments
 (0)