🔧 生成器
✅ 验证器
robots.txt 是放置在网站根目录下的纯文本文件(如 https://example.com/robots.txt),用于告诉搜索引擎爬虫哪些页面可以抓取、哪些页面应该忽略。它是 Robots Exclusion Protocol(机器人排除协议)的一部分,是 SEO 技术优化的基础文件之一。
| 指令 | 语法 | 说明 |
|---|---|---|
| User-agent | User-agent: * | 指定规则适用的爬虫。* 代表所有爬虫,也可指定如 Googlebot、Bingbot 等 |
| Disallow | Disallow: /admin/ | 禁止抓取指定路径。/ 禁止所有页面,留空则允许所有 |
| Allow | Allow: /admin/public/ | 在 Disallow 的基础上,允许抓取特定子路径(Google/Bing 支持) |
| Sitemap | Sitemap: https://... | 告知搜索引擎 sitemap 文件的位置,必须使用完整 URL |
| Crawl-delay | Crawl-delay: 10 | 要求爬虫在两次请求之间等待的秒数(Bing/Yandex 支持,Google 不支持) |
| Host | Host: example.com | 指定网站的首选域名(仅 Yandex 支持) |
* — 匹配任意字符序列。如 Disallow: /*.pdf$ 屏蔽所有 PDF 文件$ — 匹配 URL 结尾。如 Disallow: /page$ 仅屏蔽 /page 但不屏蔽 /page/sub* 和 $ 仅 Google 和 Bing 支持,不是标准 robots.txt 规范的一部分。
| User-agent | 对应搜索引擎 |
|---|---|
* | 所有爬虫(通配符) |
Googlebot | Google 网页搜索 |
Googlebot-Image | Google 图片搜索 |
Bingbot | Bing 搜索 |
Slurp | Yahoo 搜索 |
DuckDuckBot | DuckDuckGo 搜索 |
Baiduspider | 百度搜索 |
YandexBot | Yandex 搜索 |
facebot | Facebook 爬虫 |
Twitterbot | Twitter/X 爬虫 |
GPTBot | OpenAI GPT 爬虫 |
ChatGPT-User | ChatGPT 浏览功能 |
Claude-Web | Anthropic Claude 爬虫 |
CCBot | Common Crawl 爬虫 |
https://example.com/robots.txt/ 开头才有效https:// 绝对 URL设置允许或禁止Googlebot、Bingbot等搜索引擎爬虫的访问路径。
添加需要屏蔽的目录路径,如/admin/、/private/等。
填入XML Sitemap的完整URL地址。
预览生成的robots.txt内容,下载后上传到网站根目录。
必须放在网站根目录,即https://example.com/robots.txt。
不能。它只阻止抓取,不阻止索引。要阻止索引需使用noindex标签。
Google忽略Crawl-delay,但Bing和Yandex会遵守。
可以用User-agent: *统一设置,也可以为特定爬虫单独配置。
搜索引擎通常几小时到几天内重新读取,可在Search Console中提交加速。