Skip to content

Commit 6ff3ca0

Browse files
authored
Add explicit AI crawler allowlist to docs robots.txt (#43599)
1 parent a7b6500 commit 6ff3ca0

2 files changed

Lines changed: 52 additions & 63 deletions

File tree

docs/public/robots.txt

Lines changed: 5 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,31 @@
1-
# Allow all crawlers by default
21
User-agent: *
32
Allow: /
43

5-
# Explicitly list major AI crawlers for clarity and signaling.
6-
# The wildcard rule above already permits all bots; the entries below
7-
# make it unambiguous to AI indexers that they are welcome here.
84
User-agent: GPTBot
95
Allow: /
106

11-
User-agent: ChatGPT-User
12-
Allow: /
13-
147
User-agent: OAI-SearchBot
158
Allow: /
169

17-
User-agent: Google-Extended
10+
User-agent: ChatGPT-User
1811
Allow: /
1912

20-
User-agent: Googlebot
13+
User-agent: anthropic-ai
2114
Allow: /
2215

2316
User-agent: ClaudeBot
2417
Allow: /
2518

26-
User-agent: Claude-Web
27-
Allow: /
28-
29-
User-agent: anthropic-ai
30-
Allow: /
31-
3219
User-agent: PerplexityBot
3320
Allow: /
3421

3522
User-agent: Perplexity-User
3623
Allow: /
3724

38-
User-agent: Applebot
39-
Allow: /
40-
41-
User-agent: Applebot-Extended
42-
Allow: /
43-
44-
User-agent: Amazonbot
45-
Allow: /
46-
47-
User-agent: cohere-ai
48-
Allow: /
49-
50-
User-agent: Omgilibot
51-
Allow: /
52-
53-
User-agent: FacebookBot
54-
Allow: /
55-
56-
User-agent: Bytespider
57-
Allow: /
58-
59-
User-agent: bingbot
60-
Allow: /
61-
62-
User-agent: BingPreview
63-
Allow: /
64-
65-
User-agent: DuckDuckBot
66-
Allow: /
67-
68-
User-agent: Slurp
69-
Allow: /
70-
71-
User-agent: YandexBot
72-
Allow: /
73-
74-
User-agent: Baiduspider
75-
Allow: /
76-
77-
User-agent: ia_archiver
78-
Allow: /
79-
80-
User-agent: CCBot
81-
Allow: /
82-
83-
User-agent: DataForSeoBot
25+
User-agent: Google-Extended
8426
Allow: /
8527

86-
User-agent: Diffbot
28+
User-agent: Google-CloudVertexBot
8729
Allow: /
8830

89-
Sitemap: https://github.github.com/gh-aw/sitemap.xml
31+
Sitemap: https://github.github.com/gh-aw/sitemap-index.xml

docs/tests/robots-txt.spec.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { test, expect } from '@playwright/test';
2+
3+
const EXPECTED_ROBOTS_TXT = [
4+
'User-agent: *',
5+
'Allow: /',
6+
'',
7+
'User-agent: GPTBot',
8+
'Allow: /',
9+
'',
10+
'User-agent: OAI-SearchBot',
11+
'Allow: /',
12+
'',
13+
'User-agent: ChatGPT-User',
14+
'Allow: /',
15+
'',
16+
'User-agent: anthropic-ai',
17+
'Allow: /',
18+
'',
19+
'User-agent: ClaudeBot',
20+
'Allow: /',
21+
'',
22+
'User-agent: PerplexityBot',
23+
'Allow: /',
24+
'',
25+
'User-agent: Perplexity-User',
26+
'Allow: /',
27+
'',
28+
'User-agent: Google-Extended',
29+
'Allow: /',
30+
'',
31+
'User-agent: Google-CloudVertexBot',
32+
'Allow: /',
33+
'',
34+
'Sitemap: https://github.github.com/gh-aw/sitemap-index.xml',
35+
'',
36+
].join('\n');
37+
38+
test.describe('robots.txt', () => {
39+
test('should contain only the expected AI crawler directives and sitemap index', async ({ request }) => {
40+
const response = await request.get('/gh-aw/robots.txt');
41+
expect(response.ok()).toBeTruthy();
42+
43+
const body = (await response.text()).replace(/\r\n/g, '\n');
44+
45+
expect(body).toBe(EXPECTED_ROBOTS_TXT);
46+
});
47+
});

0 commit comments

Comments
 (0)