放开 AI 爬虫抓取全流程操作(GEO 需要 4 步:robots→CDN/WAF→服务器防火墙→新增 llms.txt)
国内大模型:豆包 Bot、文心爬虫、通义千问爬虫、DeepSeekBot;海外:GPTBot、Claude、Google-Extended、Perplexity,全部放行才能被 AI 收录引用
一、修改网站根目录 robots.txt(核心,优先级高)
文件路径:域名/robots.txt(例:xxx.com/robots.txt),*AI 规则写在文件顶部,在 User-agent:前面(规则从上往下生效)
完整放行代码(直接复制使用)
txt
# ==========放行国内+海外主流AI爬虫【GEO专用】==========
# OpenAI全爬虫(GPT、ChatGPT联网搜索)
User-agent: GPTBot
Allow: /
User-agent: ChatGPT-User
Allow: /
User-agent: OAI-SearchBot
Allow: /
# Claude(Anthropic)
User-agent: ClaudeBot
Allow: /
User-agent: Claude-Web
Allow: /
# Gemini谷歌AI爬虫(区别普通Googlebot)
User-agent: Google-Extended
Allow: /
# Perplexity
User-agent: PerplexityBot
Allow: /
User-agent: Perplexity-User
Allow: /
# 苹果Siri智能摘要
User-agent: Applebot-Extended
Allow: /
# 亚马逊、Cohere
User-agent: Amazonbot
Allow: /
User-agent: cohere-ai
Allow: /
# 国内国产大模型爬虫(豆包、文心、通义、DeepSeek)
User-agent: DoubaoBot
Allow: /
User-agent: BaiduSpider-AI
Allow: /
User-agent: QwenBot
Allow: /
User-agent: DeepSeekBot
Allow: /
# 常规搜索引擎(保留放行)
User-agent: Googlebot
Allow: /
User-agent: Bingbot
Allow: /
User-agent: Baiduspider
Allow: /
# 禁止爬虫访问后台、管理目录(安全保留,不影响前端收录)
User-agent: *
Disallow: /admin/
Disallow: /backend/
Disallow: /api/
Disallow: /login/
# 提交网站地图,引导AI抓取
Sitemap: https://你的域名/sitemap.xml
注意
不要写User-agent:* Allow:/,容易被恶意采集爬虫泛滥;单独逐个放行 AI 安全
改完 10 分钟生效,可用站长工具 robots 检测校验。
二、CDN 放行(Cloudflare / 阿里云 CDN / 腾讯云 CDN,90% 网站被 CDN 拦截 AI)
1)Cloudflare 配置(常用)
进入【安全→WAF→自定义规则→创建规则】
规则名称:放行 AI 爬虫
匹配条件:
plaintext
http.user_agent contains "GPTBot" or
http.user_agent contains "ClaudeBot" or
http.user_agent contains "Google-Extended" or
http.user_agent contains "PerplexityBot" or
http.user_agent contains "DoubaoBot" or
http.user_agent contains "BaiduSpider-AI"
执行动作:跳过剩余所有 WAF / 机器人防护规则(Skip),规则置顶;
关闭:【安全→机器人→机器人防御】里的Block AI Scrapers(拦截 AI 采集开关)。
2)阿里云 / 腾讯云 CDN/WAF
防护规则→白名单→UA 白名单,批量添加上面所有 AI UA 关键词;
关闭 CC 防护、智能爬虫拦截里的「拦截 AI 爬虫」选项。
三、第三步:服务器防火墙放行(Nginx/Apache/ 宝塔面板)
1、宝塔面板(企业建站主流)
宝塔→网站→配置文件→Nginx 配置,删除拦截爬虫 UA 的 if 判断代码;
防火墙→安全防护→爬虫防护,关闭【拦截 AI 机器人】,添加 UA 白名单:GPTBot、ClaudeBot、DoubaoBot、Google-Extended;
禁止设置频率限制(限制单 IP 访问频次会导致 AI 分批抓取失败)。
2、Nginx 手动配置放行(可选)
nginx
if ($http_user_agent ~* "(GPTBot|ClaudeBot|DoubaoBot|Google-Extended|PerplexityBot)") {
allow all;
}
排查技巧:服务器查看网站访问日志,出现403/503= 被拦截;200 = 正常抓取。
四、第四步:新增 llms.txt(2025 起 AI 新标准,大幅提升收录引用率)
在网站根目录新建llms.txt,专门给大模型读取站点目录、内容简介(GEO 优化需要)
llms.txt 示例内容
plaintext
# XX企业官网 AI数据源指引
## 企业简介:主营XX产品、行业解决方案,成立XX年
## 栏目目录
- /product/ 全系列产品参数
- /article/ 行业科普、选型问答
- /case/ 落地项目案例
- /about/ 企业资质信息
作用:豆包、GPT、通义等 AI 优先读取 llms.txt 快速抓取全站,显著提升内容被 AI 答案引用概率。
五、常见踩坑避坑
网站加了防采集插件(如 WP 防爬虫、织梦安全插件):插件黑名单删掉全部 AI 爬虫 UA,否则 robots 放行也无效;
全站开启 JS 验证、人机验证:AI 爬虫无法过验证,直接抓取失败,产品 / 资讯页关闭验证码;
频繁改 UA 规则、关停服务器:AI 爬虫需要 1~3 周重新收录。
六、验证是否生效
访问:域名 /robots.txt,查看代码是否正常展示;
用 UA 模拟工具:填入 GPTBot,访问页面,返回 200 即放行成功。
