跳到主要内容
IM智引科技

研究 / 外贸与 B2B 增长

llms.txt 与 AI 爬虫优化:让 AI 搜索引擎优先引用你的站点

robots.txt 管传统爬虫,llms.txt 管 AI 抓取。这篇讲 llms.txt 的格式规范与实际效果(含客观评估:它还不是官方标准)、主流 AI 爬虫的 User-Agent 列表与放行策略、以及比 llms.txt 更重要的技术前提——内容必须服务端渲染。

BLKTECH 编辑部2026年8月4日10 分钟难度 进阶免费Astro

llms.txt放在网站根目录,用Markdown格式列出站点结构和核心页面,帮AI快速理解站点。但它目前不是官方标准,各AI厂商支持程度不一。更重要的前提是:内容必须服务端渲染(AI爬虫大多不执行JS),以及在robots.txt里放行GPTBot、ClaudeBot、PerplexityBot等AI爬虫。

llms.txt 与 AI 爬虫优化:让 AI 搜索引擎优先引用你的站点

先说清楚 llms.txt 的实际状态

llms.txt 是一个社区提出的约定(由 Jeremy Howard 于 2024 年提出),用于帮助 LLM 快速理解网站结构和核心内容。

客观事实

  • 不是 W3C 或任何标准组织的官方规范
  • 各 AI 厂商对它的支持程度不一,且大多未公开说明是否读取
  • 实测效果难以量化验证

为什么还是建议做

  • 成本极低(一个文本文件,30分钟内完成)
  • 如果未来被广泛采纳,你已经就位
  • 编写过程本身会强迫你梳理站点结构,对内部信息架构有帮助

不要过度期待:llms.txt 不会立刻让 ChatGPT 开始引用你。真正影响 AI 引用的是内容质量和结构(前两篇讲的自包含 FAQ、HTML 参数表、标准引用)。


llms.txt 格式规范

放在网站根目录:https://yourdomain.com/llms.txt

使用 Markdown 格式:

# AquaFlow Industrial

> Manufacturer of industrial centrifugal, submersible, and magnetic drive
> pumps for chemical processing, water treatment, and food manufacturing.
> Established 2003. ISO 9001:2015 certified. Based in Foshan, China.
> Exports to North America, Europe, and Southeast Asia.

## Products

- [Centrifugal Pumps](https://www.aquaflowpumps.com/products/centrifugal-pumps/): Single-stage end-suction pumps, flow 5–500 m³/h, ISO 5199 compliant
- [Submersible Pumps](https://www.aquaflowpumps.com/products/submersible-pumps/): Dewatering and sewage pumps, flow 10–300 m³/h
- [Magnetic Drive Pumps](https://www.aquaflowpumps.com/products/magnetic-drive-pumps/): Sealless design for toxic and volatile media, API 685 compliant

## Applications

- [Chemical Transfer](https://www.aquaflowpumps.com/applications/chemical-transfer/): Corrosion-resistant pump selection for acids, alkalis, solvents (pH 1–13)
- [Water Treatment](https://www.aquaflowpumps.com/applications/water-treatment/): NSF/ANSI 61 certified pumps for municipal and industrial water
- [Food Processing](https://www.aquaflowpumps.com/applications/food-processing/): 3-A and EHEDG compliant hygienic pumps

## Technical Resources

- [Pump Power Calculator](https://www.aquaflowpumps.com/tools/pump-power-calculator/): Calculate required motor size from flow, head, and efficiency
- [Centrifugal vs Gear Pump](https://www.aquaflowpumps.com/blog/centrifugal-vs-gear-pump/): Engineering selection guide
- [NPSH Explained](https://www.aquaflowpumps.com/blog/npsh-explained/): Cavitation prevention guide

## Company

- [About Us](https://www.aquaflowpumps.com/about/): Company profile, certifications, manufacturing capabilities
- [Contact](https://www.aquaflowpumps.com/contact/): Sales inquiries, technical support

## Certifications

ISO 9001:2015 (TÜV Rheinland), CE (EN 809), ATEX 2014/34/EU (optional),
NSF/ANSI 61 (selected models), 3-A Sanitary Standards (food-grade series)

格式要点

  • # 标题:公司/网站名
  • > 引用块:站点核心描述(简洁,包含关键实体信息)
  • ## 分类:按内容类型分组
  • 每个链接后加简短描述(帮 LLM 理解页面内容)

在 Astro 中生成 llms.txt

创建 src/pages/llms.txt.ts

import type { APIRoute } from 'astro';
import { getCollection } from 'astro:content';

const SITE = 'https://www.aquaflowpumps.com';

export const GET: APIRoute = async () => {
  const products = await getCollection('products');
  const applications = await getCollection('applications');
  const blog = await getCollection('blog');

  const pillars = products.filter(p => p.data.pageType === 'pillar');

  const content = `# AquaFlow Industrial

> Manufacturer of industrial centrifugal, submersible, and magnetic drive
> pumps for chemical processing, water treatment, and food manufacturing.
> Established 2003. ISO 9001:2015 certified.

## Products

${pillars.map(p =>
  `- [${p.data.title}](${SITE}/products/${p.slug}/): ${p.data.description}`
).join('\n')}

## Applications

${applications.map(a =>
  `- [${a.data.title}](${SITE}/applications/${a.slug}/): ${a.data.description}`
).join('\n')}

## Technical Resources

${blog.slice(0, 15).map(b =>
  `- [${b.data.title}](${SITE}/blog/${b.slug}/): ${b.data.description}`
).join('\n')}

## Company

- [About Us](${SITE}/about/): Company profile and certifications
- [Contact](${SITE}/contact/): Sales and technical inquiries
`;

  return new Response(content, {
    headers: { 'Content-Type': 'text/plain; charset=utf-8' },
  });
};

这样 llms.txt 会随内容自动更新,不需要手工维护。


robots.txt 中的 AI 爬虫策略(比 llms.txt 更重要)

如果你的 robots.txt 屏蔽了 AI 爬虫,那么无论内容多好,AI 搜索都无法引用你。

主流 AI 爬虫 User-Agent

User-Agent 归属 用途
GPTBot OpenAI 训练数据抓取
OAI-SearchBot OpenAI ChatGPT 搜索索引
ChatGPT-User OpenAI 用户实时请求时抓取
ClaudeBot Anthropic 训练数据抓取
Claude-Web Anthropic Claude 实时检索
PerplexityBot Perplexity 搜索索引
Google-Extended Google Gemini 训练(不影响 Google 搜索排名)
Applebot-Extended Apple Apple Intelligence
Bytespider 字节跳动 豆包等
CCBot Common Crawl 公开数据集(被多个 LLM 使用)

建议的 robots.txt 配置

目标是获得 AI 搜索流量(推荐给外贸站):

# robots.txt

# 传统搜索引擎
User-agent: *
Allow: /
Disallow: /search
Disallow: /admin

# AI 搜索引擎爬虫 — 明确放行
User-agent: GPTBot
Allow: /

User-agent: OAI-SearchBot
Allow: /

User-agent: ChatGPT-User
Allow: /

User-agent: ClaudeBot
Allow: /

User-agent: Claude-Web
Allow: /

User-agent: PerplexityBot
Allow: /

User-agent: Google-Extended
Allow: /

Sitemap: https://www.aquaflowpumps.com/sitemap-index.xml

为什么外贸站应该全部放行:你的目标是让潜在买家在任何渠道找到你。AI 搜索是新的流量入口,屏蔽它等于主动放弃这部分询盘。

内容被用于模型训练,对 B2B 制造商来说风险很低——你的产品参数本来就是公开信息,被更多渠道传播是好事。


更重要的技术前提:服务端渲染

这是很多人忽略的关键点。

大多数 AI 爬虫不执行 JavaScript。如果你的页面内容是靠客户端 JS 渲染的(如 React SPA 未做 SSR),AI 爬虫抓到的是空白页面。

Astro 的优势:默认静态生成(SSG),所有内容在构建时渲染成 HTML,AI 爬虫可以直接读取。

验证方法

# 用 curl 抓取页面,看是否包含实际内容
curl -s https://www.yourdomain.com/products/centrifugal-pumps/ | grep -i "centrifugal"

# 如果返回内容包含你的正文文字 → 服务端渲染正常 ✅
# 如果只返回 <div id="root"></div> → 客户端渲染,AI 爬虫看不到内容 ❌

优先级总结

如果时间有限,按这个优先级投入:

优先级 1(必做):确认内容是服务端渲染,AI 爬虫能读到
优先级 2(必做):robots.txt 放行主流 AI 爬虫
优先级 3(高回报):FAQ 自包含格式 + HTML 参数表(前两篇内容)
优先级 4(低成本可做):llms.txt

llms.txt 排在最后——不是没用,而是其他三项的确定性回报更高。


补充:llms.txt 可以不用手写

上面那份格式是按页面组织的:产品分区、应用分区、资源分区,列出站点结构。

如果你后来建了 GEO 意图注册表,llms.txt 可以直接从它生成,而且改成按问题组织:

## Selection and sizing
- [What pump material for 60% sulfuric acid at 80°C?](https://…/applications/chemical-transfer-pump/#material-selection)

## Product specifications
- [What is the maximum operating temperature of the CP-100?](https://…/products/cp-100/#max-operating-temperature)

一个爬虫或 agent 拿到这份清单,能直接知道“这个站能回答哪些具体问题、答案在哪一块”——比“这个站有一个产品分区”的信息量大得多,而且它是自动生成的,不会随页面改动而过期。

生成脚本在GEO 意图注册表工具箱但优先级不变:它依然排在第 4 位,是顺手做的副产品,不是重点。


→ E-E-A-T 在 AI 搜索时代的信号建设(品牌提及 + 实体权威)

NEXT ACTION / 下一步

继续系列:AI 外贸站建设全系列

把读到的方法变成一个小行动,完成后再回来迭代。

继续

RELATED / 相关推荐

接着读这些

按同一分类、系列与标签为你挑选。