ai-search-optimization
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAI Search Optimization (AEO & GEO)
AI搜索优化(AEO & GEO)
Scope: Optimizing content for AI-powered search engines and answer engines This skill covers strategies for visibility in ChatGPT, Perplexity, Google AI Overviews, Microsoft Copilot, and other generative AI platforms.
适用范围: 针对AI驱动搜索引擎及答案引擎优化内容 本技能涵盖ChatGPT、Perplexity、Google AI概览、Microsoft Copilot及其他生成式AI平台的可见性优化策略。
1. Understanding AEO & GEO
1. 理解AEO与GEO
What is AEO (Answer Engine Optimization)?
什么是AEO(答案引擎优化)?
Answer Engine Optimization focuses on structuring content to provide direct, concise answers to user queries through AI-powered platforms. Unlike traditional SEO which aims for link clicks, AEO optimizes for being cited as the answer source.
Target platforms:
- Google AI Overviews (formerly SGE)
- Perplexity AI
- ChatGPT Search
- Microsoft Copilot Search
- Voice assistants (Siri, Alexa, Google Assistant)
答案引擎优化专注于构建内容结构,以便通过AI驱动平台为用户查询提供直接、简洁的答案。与旨在获取链接点击的传统SEO不同,AEO的优化目标是被作为答案来源引用。
目标平台:
- Google AI概览(原SGE)
- Perplexity AI
- ChatGPT搜索
- Microsoft Copilot搜索
- 语音助手(Siri、Alexa、Google Assistant)
What is GEO (Generative Engine Optimization)?
什么是GEO(生成引擎优化)?
Generative Engine Optimization is the broader discipline of enhancing content visibility within AI-generated search results. It targets generative engines that synthesize answers from multiple sources rather than presenting traditional link lists.
Key differences from traditional SEO:
| Aspect | Traditional SEO | AEO/GEO |
|---|---|---|
| Goal | Rank in SERPs | Be cited in AI answers |
| User behavior | Click through to site | Get answer directly |
| Content format | Keyword-optimized pages | Structured, citable content |
| Success metric | Click-through rate | Citation frequency |
| Query type | Short keywords | Conversational, long-tail |
生成引擎优化是提升内容在AI生成搜索结果中可见性的更广泛学科。它针对的是会从多个来源合成答案而非展示传统链接列表的生成式引擎。
与传统SEO的主要区别:
| 维度 | 传统SEO | AEO/GEO |
|---|---|---|
| 目标 | 在搜索结果页面(SERPs)排名 | 被AI答案引用 |
| 用户行为 | 点击进入网站 | 直接获取答案 |
| 内容格式 | 关键词优化页面 | 结构化、可引用内容 |
| 成功指标 | 点击率 | 引用频率 |
| 查询类型 | 短关键词 | 对话式、长尾查询 |
The AI Search Landscape (2025-2026)
AI搜索格局(2025-2026)
- Google AI Overviews: 2B+ monthly users across 200 countries (TechCrunch)
- Google AI Mode: 100M+ monthly users in US and India
- ChatGPT Search: Real-time web search with citations
- Perplexity AI: Real-time citation engine, emphasis on freshness
- Microsoft Copilot Search: Bing integration with generative AI
- Zero-click searches: About 60% of global searches end without a click (neotype.ai)
- Google AI概览: 覆盖200多个国家,月活用户超20亿(来源:TechCrunch)
- Google AI模式: 美国和印度月活用户超1亿
- ChatGPT搜索: 带引用的实时网页搜索
- Perplexity AI: 实时引用引擎,强调内容新鲜度
- Microsoft Copilot搜索: 集成生成式AI的Bing搜索
- 零点击搜索: 全球约60%的搜索无需点击即可完成(来源:neotype.ai)
2. Content Structure for AI Readability
2. 面向AI可读性的内容结构
Semantic HTML Structure
语义化HTML结构
AI systems extract information more effectively from well-structured content:
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Descriptive, Question-Answering Title</title>
</head>
<body>
<article>
<header>
<h1>Primary Topic as Question or Clear Statement</h1>
<p class="summary">Direct 2-3 sentence answer to the main question.</p>
</header>
<main>
<section>
<h2>Subtopic Heading</h2>
<p>Detailed explanation with facts and data.</p>
<ul>
<li>Key point 1 with specific information</li>
<li>Key point 2 with verifiable data</li>
<li>Key point 3 with actionable insight</li>
</ul>
</section>
</main>
<aside>
<h3>Quick Facts</h3>
<dl>
<dt>Term</dt>
<dd>Definition</dd>
</dl>
</aside>
</article>
</body>
</html>AI系统能更有效地从结构良好的内容中提取信息:
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Descriptive, Question-Answering Title</title>
</head>
<body>
<article>
<header>
<h1>Primary Topic as Question or Clear Statement</h1>
<p class="summary">Direct 2-3 sentence answer to the main question.</p>
</header>
<main>
<section>
<h2>Subtopic Heading</h2>
<p>Detailed explanation with facts and data.</p>
<ul>
<li>Key point 1 with specific information</li>
<li>Key point 2 with verifiable data</li>
<li>Key point 3 with actionable insight</li>
</ul>
</section>
</main>
<aside>
<h3>Quick Facts</h3>
<dl>
<dt>Term</dt>
<dd>Definition</dd>
</dl>
</aside>
</article>
</body>
</html>Heading Hierarchy Best Practices
标题层级最佳实践
markdown
undefinedmarkdown
undefinedH1: Main Topic (contains primary question/keyword)
H1: 主题(包含核心问题/关键词)
└── ## H2: Major subtopic
└── ### H3: Specific aspect
└── #### H4: Details (use sparingly)
**Rules:**
- Single H1 per page
- H1 should answer "What is this page about?"
- Use question-format headings when appropriate
- Include target keywords naturally└── ## H2: 主要子主题
└── ### H3: 具体方面
└── #### H4: 细节(谨慎使用)
**规则:**
- 每页仅一个H1
- H1应回答“本页面是关于什么的?”
- 适当使用问题格式的标题
- 自然融入目标关键词The Inverted Pyramid Pattern
倒金字塔模式
Structure content for AI extraction:
┌─────────────────────────────────────┐
│ DIRECT ANSWER (First 1-2 │ ← AI extracts this
│ sentences answer the query) │
├─────────────────────────────────────┤
│ KEY FACTS & CONTEXT │ ← Supporting evidence
│ (Bullet points, data, quotes) │
├─────────────────────────────────────┤
│ DETAILED EXPLANATION │ ← Comprehensive coverage
│ (Background, methodology, │
│ examples, case studies) │
├─────────────────────────────────────┤
│ RELATED TOPICS │ ← Topic authority signals
│ (Links to related content) │
└─────────────────────────────────────┘为AI提取优化内容结构:
┌─────────────────────────────────────┐
│ 直接答案(开头1-2句回答查询) │ ← AI提取此部分
├─────────────────────────────────────┤
│ 关键事实与上下文 │ ← 支持证据
│ (项目符号、数据、引用) │
├─────────────────────────────────────┤
│ 详细解释 │ ← 全面覆盖
│ (背景、方法论、 │
│ 示例、案例研究) │
├─────────────────────────────────────┤
│ 相关主题 │ ← 主题权威性信号
│ (指向相关内容的链接) │
└─────────────────────────────────────┘Lists and Tables for Extraction
便于提取的列表与表格
AI engines prefer structured data formats:
html
<!-- Comparison Table -->
<table>
<caption>Feature Comparison: Product A vs Product B</caption>
<thead>
<tr>
<th>Feature</th>
<th>Product A</th>
<th>Product B</th>
</tr>
</thead>
<tbody>
<tr>
<td>Price</td>
<td>$99/month</td>
<td>$149/month</td>
</tr>
<!-- More rows -->
</tbody>
</table>
<!-- Definition List for Terms -->
<dl>
<dt>AEO</dt>
<dd>Answer Engine Optimization - optimizing content for direct answers</dd>
<dt>GEO</dt>
<dd>Generative Engine Optimization - visibility in AI-generated results</dd>
</dl>
<!-- Step-by-Step Process -->
<ol>
<li>Step one with clear action</li>
<li>Step two with measurable outcome</li>
<li>Step three with verification method</li>
</ol>AI引擎偏好结构化数据格式:
html
<!-- 对比表格 -->
<table>
<caption>Feature Comparison: Product A vs Product B</caption>
<thead>
<tr>
<th>Feature</th>
<th>Product A</th>
<th>Product B</th>
</tr>
</thead>
<tbody>
<tr>
<td>Price</td>
<td>$99/month</td>
<td>$149/month</td>
</tr>
<!-- 更多行 -->
</tbody>
</table>
<!-- 术语定义列表 -->
<dl>
<dt>AEO</dt>
<dd>Answer Engine Optimization - 优化内容以提供直接答案</dd>
<dt>GEO</dt>
<dd>Generative Engine Optimization - 在AI生成结果中提升可见性</dd>
</dl>
<!-- 分步流程 -->
<ol>
<li>明确操作步骤</li>
<li>可衡量结果的步骤</li>
<li>带验证方法的步骤</li>
</ol>3. Schema Markup for AI Understanding
3. 助力AI理解的Schema标记
Essential Schema Types
核心Schema类型
Research shows structured data significantly improves AI search visibility:
- Pages with schema are up to 40% more likely to appear in Google AI Overviews (zarkx.com)
- Organization schema: 2.8x increase in citation frequency
- FAQPage schema: 2.5x rise in answer inclusion
- Article schema: 2.2x boost in content citations
- Sites with 15+ schema types see 2.4x higher citation rates (surgeboom.com)
研究表明,结构化数据能显著提升AI搜索可见性:
- 带有Schema的页面在Google AI概览中出现的概率最高提升40%(来源:zarkx.com)
- Organization Schema:引用频率提升2.8倍
- FAQPage Schema:答案纳入率提升2.5倍
- Article Schema:内容引用率提升2.2倍
- 使用15种以上Schema类型的网站,引用率提升2.4倍(来源:surgeboom.com)
FAQPage Schema
FAQPage Schema
json
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What is Answer Engine Optimization?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Answer Engine Optimization (AEO) is a strategic approach to structuring content so AI platforms like ChatGPT, Perplexity, and Google AI Overviews can easily extract and cite it as direct answers to user queries."
}
},
{
"@type": "Question",
"name": "How is AEO different from SEO?",
"acceptedAnswer": {
"@type": "Answer",
"text": "While SEO focuses on ranking in traditional search results for clicks, AEO optimizes content to be cited directly in AI-generated answers, often resulting in zero-click interactions where users get information without visiting the source."
}
}
]
}json
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What is Answer Engine Optimization?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Answer Engine Optimization (AEO) is a strategic approach to structuring content so AI platforms like ChatGPT, Perplexity, and Google AI Overviews can easily extract and cite it as direct answers to user queries."
}
},
{
"@type": "Question",
"name": "How is AEO different from SEO?",
"acceptedAnswer": {
"@type": "Answer",
"text": "While SEO focuses on ranking in traditional search results for clicks, AEO optimizes content to be cited directly in AI-generated answers, often resulting in zero-click interactions where users get information without visiting the source."
}
}
]
}HowTo Schema
HowTo Schema
json
{
"@context": "https://schema.org",
"@type": "HowTo",
"name": "How to Optimize Content for AI Search",
"description": "Step-by-step guide to improving visibility in AI-powered search engines",
"totalTime": "PT30M",
"step": [
{
"@type": "HowToStep",
"name": "Structure Content Semantically",
"text": "Use proper HTML5 semantic elements like article, section, and aside",
"position": 1
},
{
"@type": "HowToStep",
"name": "Implement Schema Markup",
"text": "Add FAQPage, HowTo, and Article schema to your pages",
"position": 2
},
{
"@type": "HowToStep",
"name": "Optimize for Conversational Queries",
"text": "Write content that answers natural language questions",
"position": 3
}
]
}json
{
"@context": "https://schema.org",
"@type": "HowTo",
"name": "How to Optimize Content for AI Search",
"description": "Step-by-step guide to improving visibility in AI-powered search engines",
"totalTime": "PT30M",
"step": [
{
"@type": "HowToStep",
"name": "Structure Content Semantically",
"text": "Use proper HTML5 semantic elements like article, section, and aside",
"position": 1
},
{
"@type": "HowToStep",
"name": "Implement Schema Markup",
"text": "Add FAQPage, HowTo, and Article schema to your pages",
"position": 2
},
{
"@type": "HowToStep",
"name": "Optimize for Conversational Queries",
"text": "Write content that answers natural language questions",
"position": 3
}
]
}Article Schema with Author
带作者信息的Article Schema
json
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "Complete Guide to AI Search Optimization",
"description": "Learn how to optimize content for ChatGPT, Perplexity, and Google AI Overviews",
"datePublished": "2025-01-15",
"dateModified": "2025-01-15",
"author": {
"@type": "Person",
"name": "Expert Name",
"url": "https://example.com/about/expert-name",
"jobTitle": "SEO Specialist",
"sameAs": [
"https://linkedin.com/in/expertname",
"https://twitter.com/expertname"
]
},
"publisher": {
"@type": "Organization",
"name": "Company Name",
"logo": {
"@type": "ImageObject",
"url": "https://example.com/logo.png"
}
}
}json
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "Complete Guide to AI Search Optimization",
"description": "Learn how to optimize content for ChatGPT, Perplexity, and Google AI Overviews",
"datePublished": "2025-01-15",
"dateModified": "2025-01-15",
"author": {
"@type": "Person",
"name": "Expert Name",
"url": "https://example.com/about/expert-name",
"jobTitle": "SEO Specialist",
"sameAs": [
"https://linkedin.com/in/expertname",
"https://twitter.com/expertname"
]
},
"publisher": {
"@type": "Organization",
"name": "Company Name",
"logo": {
"@type": "ImageObject",
"url": "https://example.com/logo.png"
}
}
}Organization Schema
Organization Schema
json
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Company Name",
"url": "https://example.com",
"logo": "https://example.com/logo.png",
"description": "Brief description of what the organization does",
"foundingDate": "2010",
"sameAs": [
"https://www.linkedin.com/company/companyname",
"https://twitter.com/companyname",
"https://github.com/companyname"
],
"contactPoint": {
"@type": "ContactPoint",
"telephone": "+1-555-123-4567",
"contactType": "customer service",
"availableLanguage": ["English", "German"]
}
}json
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Company Name",
"url": "https://example.com",
"logo": "https://example.com/logo.png",
"description": "Brief description of what the organization does",
"foundingDate": "2010",
"sameAs": [
"https://www.linkedin.com/company/companyname",
"https://twitter.com/companyname",
"https://github.com/companyname"
],
"contactPoint": {
"@type": "ContactPoint",
"telephone": "+1-555-123-4567",
"contactType": "customer service",
"availableLanguage": ["English", "German"]
}
}4. E-E-A-T Signals for AI Trust
4. 提升AI信任度的E-E-A-T信号
Experience, Expertise, Authoritativeness, Trustworthiness
经验、专业知识、权威性、可信度
AI systems prioritize content from credible sources. Implement these signals:
AI系统优先选择可信来源的内容。实施以下信号:
Author Bios
作者简介
html
<article>
<!-- Content -->
<footer class="author-bio">
<img src="/authors/jane-doe.jpg" alt="Jane Doe" />
<div class="author-info">
<h4>About the Author</h4>
<p class="author-name">Jane Doe, PhD</p>
<p class="author-credentials">
15 years of experience in digital marketing.
Former Head of SEO at Fortune 500 company.
Published in Search Engine Journal, Moz, and Ahrefs Blog.
</p>
<ul class="author-links">
<li><a href="https://linkedin.com/in/janedoe" rel="author">LinkedIn</a></li>
<li><a href="https://twitter.com/janedoe" rel="author">Twitter</a></li>
</ul>
</div>
</footer>
</article>html
<article>
<!-- 内容 -->
<footer class="author-bio">
<img src="/authors/jane-doe.jpg" alt="Jane Doe" />
<div class="author-info">
<h4>About the Author</h4>
<p class="author-name">Jane Doe, PhD</p>
<p class="author-credentials">
15 years of experience in digital marketing.
Former Head of SEO at Fortune 500 company.
Published in Search Engine Journal, Moz, and Ahrefs Blog.
</p>
<ul class="author-links">
<li><a href="https://linkedin.com/in/janedoe" rel="author">LinkedIn</a></li>
<li><a href="https://twitter.com/janedoe" rel="author">Twitter</a></li>
</ul>
</div>
</footer>
</article>Trust Signals Checklist
信任信号检查清单
- Author expertise: Detailed bios with credentials and experience
- Citations: Link to reputable sources (studies, official docs, experts)
- Contact information: Clear "About Us" and "Contact" pages
- HTTPS: Secure connection required
- Privacy policy: Transparent data handling
- Update dates: Visible "Last updated" timestamps
- Original research: Proprietary data, case studies, expert quotes
- Reviews/testimonials: Third-party validation where applicable
- 作者专业知识: 包含资质和经验的详细简介
- 引用: 链接到权威来源(研究、官方文档、专家内容)
- 联系信息: 清晰的“关于我们”和“联系我们”页面
- HTTPS: 要求安全连接
- 隐私政策: 透明的数据处理说明
- 更新日期: 可见的“最后更新”时间戳
- 原创研究: 专有数据、案例研究、专家引用
- 评价/推荐: 适用时提供第三方验证
Building Domain Authority
构建域名权威性
- Earn quality backlinks from reputable industry sites
- Get mentioned in authoritative publications
- Contribute guest posts to established platforms
- Participate in industry forums and communities
- Create original research that others cite
- 获取优质反向链接 来自行业权威网站
- 被权威出版物提及
- 在知名平台发表客座文章
- 参与行业论坛和社区
- 创建他人会引用的原创研究
5. Content Freshness Strategy
5. 内容新鲜度策略
Update Frequency by Platform
各平台更新频率
| Platform | Freshness Preference | Recommended Update Cycle |
|---|---|---|
| Perplexity AI | Very high | Every 2-3 days for trending topics |
| ChatGPT Search | High | Weekly updates |
| Google AI Overviews | Moderate | Monthly refresh |
| Bing Copilot | Moderate | Monthly refresh |
| 平台 | 新鲜度偏好 | 推荐更新周期 |
|---|---|---|
| Perplexity AI | 极高 | 热门话题每2-3天更新 |
| ChatGPT搜索 | 高 | 每周更新 |
| Google AI概览 | 中等 | 每月刷新 |
| Bing Copilot | 中等 | 每月刷新 |
Content Refresh Protocol
内容更新协议
markdown
undefinedmarkdown
undefinedContent Freshness Checklist
内容新鲜度检查清单
Weekly Tasks
每周任务
- Update statistics with latest data
- Refresh screenshots and examples
- Add new developments or news
- Update "Last modified" timestamp
- 用最新数据更新统计信息
- 刷新截图和示例
- 添加新进展或新闻
- 更新“最后修改”时间戳
Monthly Tasks
每月任务
- Review and update all factual claims
- Add new sections for emerging topics
- Update broken links
- Refresh expert quotes
- 审核并更新所有事实声明
- 为新兴主题添加新章节
- 更新失效链接
- 刷新专家引用
Quarterly Tasks
季度任务
- Comprehensive content audit
- Competitive analysis
- Restructure based on query trends
- Update all schema markup
undefined- 全面内容审计
- 竞争分析
- 根据查询趋势重构内容
- 更新所有Schema标记
undefinedVisible Timestamps
可见时间戳
html
<article>
<header>
<h1>Article Title</h1>
<div class="article-meta">
<time datetime="2025-01-15" itemprop="datePublished">
Published: January 15, 2025
</time>
<time datetime="2025-01-15" itemprop="dateModified">
Last Updated: January 15, 2025
</time>
</div>
</header>
<!-- Content -->
</article>html
<article>
<header>
<h1>Article Title</h1>
<div class="article-meta">
<time datetime="2025-01-15" itemprop="datePublished">
Published: January 15, 2025
</time>
<time datetime="2025-01-15" itemprop="dateModified">
Last Updated: January 15, 2025
</time>
</div>
</header>
<!-- 内容 -->
</article>6. Robots.txt for AI Crawlers
6. 针对AI爬虫的Robots.txt
Allowing AI Bots
允许AI爬虫
To be indexed by AI search engines, explicitly allow their crawlers:
text
undefined要被AI搜索引擎索引,需明确允许其爬虫:
text
undefinedrobots.txt - AI Search Optimization
robots.txt - AI搜索优化
Standard search engines
标准搜索引擎
User-agent: Googlebot
Allow: /
User-agent: Bingbot
Allow: /
User-agent: Googlebot
Allow: /
User-agent: Bingbot
Allow: /
OpenAI (ChatGPT)
OpenAI (ChatGPT)
User-agent: GPTBot
Allow: /
User-agent: ChatGPT-User
Allow: /
User-agent: GPTBot
Allow: /
User-agent: ChatGPT-User
Allow: /
Perplexity AI
Perplexity AI
User-agent: PerplexityBot
Allow: /
User-agent: PerplexityBot
Allow: /
Anthropic (Claude)
Anthropic (Claude)
User-agent: ClaudeBot
Allow: /
User-agent: anthropic-ai
Allow: /
User-agent: ClaudeBot
Allow: /
User-agent: anthropic-ai
Allow: /
Google AI (Gemini)
Google AI (Gemini)
User-agent: Google-Extended
Allow: /
User-agent: Google-Extended
Allow: /
Meta AI
Meta AI
User-agent: FacebookBot
Allow: /
User-agent: FacebookBot
Allow: /
Common Crawl (used by many AI systems)
Common Crawl(被众多AI系统使用)
User-agent: CCBot
Allow: /
User-agent: CCBot
Allow: /
Microsoft/Bing AI
Microsoft/Bing AI
User-agent: Applebot
Allow: /
User-agent: Applebot
Allow: /
Default rule
默认规则
User-agent: *
Allow: /
Disallow: /admin/
Disallow: /private/
User-agent: *
Allow: /
Disallow: /admin/
Disallow: /private/
Sitemap
站点地图
Sitemap: https://example.com/sitemap.xml
undefinedSitemap: https://example.com/sitemap.xml
undefinedBlocking AI Training While Allowing AI Search (Optional)
可选:允许AI搜索但阻止AI训练
Some organizations want to be cited in AI search results but don't want their content used to train AI models. Here's how:
Understanding the difference:
| Bot | What it does | Block = |
|---|---|---|
| Crawls for training OpenAI models | Your content won't train future GPT versions |
| Live browsing when users search | ChatGPT can't cite you in real-time answers |
| Crawls for training Gemini AI | Your content won't train Gemini |
| Live search for Perplexity answers | Perplexity can't cite you |
| Common Crawl - open training datasets | Your content won't be in public AI training data |
Example: Block training, allow live search citations:
text
undefined部分组织希望在AI搜索结果中被引用,但不希望其内容被用于训练AI模型。实现方法如下:
理解区别:
| 爬虫 | 功能 | 阻止意味着 |
|---|---|---|
| 为OpenAI模型抓取训练数据 | 你的内容不会用于训练未来的GPT版本 |
| 用户搜索时的实时浏览 | ChatGPT无法在实时答案中引用你 |
| 为Gemini AI抓取训练数据 | 你的内容不会用于训练Gemini |
| Perplexity答案的实时搜索 | Perplexity无法引用你 |
| Common Crawl - 公开训练数据集 | 你的内容不会出现在公共AI训练数据中 |
示例:阻止训练,允许实时搜索引用:
text
undefinedBLOCK: AI model training (your content won't train future AI)
阻止:AI模型训练(你的内容不会用于训练未来AI)
User-agent: GPTBot
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: CCBot
Disallow: /
User-agent: GPTBot
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: CCBot
Disallow: /
ALLOW: Real-time AI search (AI can cite you in answers)
允许:实时AI搜索(AI可在答案中引用你)
User-agent: ChatGPT-User
Allow: /
User-agent: PerplexityBot
Allow: /
> **Note:** Most businesses focused on AI search visibility should **allow all bots** (Section 6 above).
> Only use this approach if you have specific concerns about AI training on your content.User-agent: ChatGPT-User
Allow: /
User-agent: PerplexityBot
Allow: /
> **注意:** 大多数专注于AI搜索可见性的企业应**允许所有爬虫**(见上文第6节)。
> 仅当你对AI训练使用你的内容有特定顾虑时,才使用此方法。AI Bot Reference
AI爬虫参考
| Bot Name | Company | Purpose |
|---|---|---|
| GPTBot | OpenAI | Training data & ChatGPT browsing |
| ChatGPT-User | OpenAI | ChatGPT web browsing |
| PerplexityBot | Perplexity | Real-time search & citations |
| ClaudeBot | Anthropic | Training & retrieval |
| anthropic-ai | Anthropic | Claude AI training |
| Google-Extended | Gemini AI training | |
| FacebookBot | Meta | Meta AI training |
| CCBot | Common Crawl | Open dataset for AI training |
| 爬虫名称 | 公司 | 用途 |
|---|---|---|
| GPTBot | OpenAI | 训练数据与ChatGPT浏览 |
| ChatGPT-User | OpenAI | ChatGPT网页浏览 |
| PerplexityBot | Perplexity | 实时搜索与引用 |
| ClaudeBot | Anthropic | 训练与检索 |
| anthropic-ai | Anthropic | Claude AI训练 |
| Google-Extended | Gemini AI训练 | |
| FacebookBot | Meta | Meta AI训练 |
| CCBot | Common Crawl | 公开AI训练数据集 |
7. Conversational Query Optimization
7. 对话式查询优化
Target Long-Tail, Question-Based Queries
针对长尾、基于问题的查询
AI search favors natural language:
Traditional keyword:
"best project management software"Conversational queries:
- "What is the best project management software for small teams?"
- "How do I choose project management software for remote work?"
- "Which project management tool has the best free plan?"
AI搜索偏好自然语言:
传统关键词:
"best project management software"对话式查询:
- "What is the best project management software for small teams?"
- "How do I choose project management software for remote work?"
- "Which project management tool has the best free plan?"
Question-Answer Content Pattern
问答内容模式
markdown
undefinedmarkdown
undefinedWhat is [Topic]?
什么是[主题]?
[Topic] is [direct definition in 1-2 sentences].
[主题]是[1-2句直接定义]。
Key characteristics:
关键特征:
- Characteristic 1
- Characteristic 2
- Characteristic 3
- 特征1
- 特征2
- 特征3
How does [Topic] work?
[主题]如何工作?
[Clear explanation of process]
[清晰的流程解释]
Step-by-step breakdown:
分步分解:
- First step
- Second step
- Third step
- 第一步
- 第二步
- 第三步
Why is [Topic] important?
为什么[主题]很重要?
[2-3 sentences on significance]
[2-3句说明重要性]
Benefits include:
优势包括:
- Benefit 1 with specific outcome
- Benefit 2 with measurable result
- Benefit 3 with real-world application
undefined- 优势1(具体成果)
- 优势2(可衡量结果)
- 优势3(实际应用)
undefinedFAQ Section Template
FAQ部分模板
html
<section class="faq">
<h2>Frequently Asked Questions</h2>
<details>
<summary>What is Answer Engine Optimization?</summary>
<p>Answer Engine Optimization (AEO) is the practice of...</p>
</details>
<details>
<summary>How is GEO different from traditional SEO?</summary>
<p>While traditional SEO focuses on...</p>
</details>
<details>
<summary>Which AI search platforms should I optimize for?</summary>
<p>The main platforms to consider are...</p>
</details>
</section>html
<section class="faq">
<h2>Frequently Asked Questions</h2>
<details>
<summary>What is Answer Engine Optimization?</summary>
<p>Answer Engine Optimization (AEO) is the practice of...</p>
</details>
<details>
<summary>How is GEO different from traditional SEO?</summary>
<p>While traditional SEO focuses on...</p>
</details>
<details>
<summary>Which AI search platforms should I optimize for?</summary>
<p>The main platforms to consider are...</p>
</details>
</section>8. Multimedia Optimization
8. 多媒体优化
Image Requirements
图片要求
Perplexity and other AI engines prefer visual content:
html
<figure>
<img
src="/images/ai-search-diagram.webp"
alt="Diagram showing how AI search engines process and cite content"
width="800"
height="450"
loading="lazy"
/>
<figcaption>
How AI search engines extract and cite content sources
</figcaption>
</figure>Best practices:
- Minimum 2 unique, relevant images per article
- Descriptive alt text (not keyword stuffing)
- WebP format for performance
- Include diagrams, infographics, process flows
- Add captions with context
Perplexity及其他AI引擎偏好视觉内容:
html
<figure>
<img
src="/images/ai-search-diagram.webp"
alt="Diagram showing how AI search engines process and cite content"
width="800"
height="450"
loading="lazy"
/>
<figcaption>
How AI search engines extract and cite content sources
</figcaption>
</figure>最佳实践:
- 每篇文章至少2张独特、相关的图片
- 描述性alt文本(不堆砌关键词)
- 使用WebP格式提升性能
- 包含图表、信息图、流程示意图
- 添加带上下文的标题
Video Integration
视频集成
html
<figure class="video-embed">
<iframe
src="https://www.youtube.com/embed/VIDEO_ID"
title="Detailed explanation of AI Search Optimization"
allow="accelerometer; autoplay; clipboard-write; encrypted-media"
allowfullscreen
></iframe>
<figcaption>
Video: Complete guide to optimizing for AI search engines
</figcaption>
</figure>html
<figure class="video-embed">
<iframe
src="https://www.youtube.com/embed/VIDEO_ID"
title="Detailed explanation of AI Search Optimization"
allow="accelerometer; autoplay; clipboard-write; encrypted-media"
allowfullscreen
></iframe>
<figcaption>
Video: Complete guide to optimizing for AI search engines
</figcaption>
</figure>Video Schema
视频Schema
json
{
"@context": "https://schema.org",
"@type": "VideoObject",
"name": "AI Search Optimization Tutorial",
"description": "Learn how to optimize content for ChatGPT, Perplexity, and Google AI",
"thumbnailUrl": "https://example.com/video-thumbnail.jpg",
"uploadDate": "2025-01-15",
"duration": "PT10M30S",
"contentUrl": "https://example.com/videos/ai-search-tutorial.mp4"
}json
{
"@context": "https://schema.org",
"@type": "VideoObject",
"name": "AI Search Optimization Tutorial",
"description": "Learn how to optimize content for ChatGPT, Perplexity, and Google AI",
"thumbnailUrl": "https://example.com/video-thumbnail.jpg",
"uploadDate": "2025-01-15",
"duration": "PT10M30S",
"contentUrl": "https://example.com/videos/ai-search-tutorial.mp4"
}9. Monitoring AI Search Visibility
9. 监控AI搜索可见性
AI Brand Monitoring Tools
AI品牌监控工具
| Tool | Platforms Monitored | Key Features |
|---|---|---|
| Semrush AI Visibility | ChatGPT, Gemini, Perplexity | Free tier, mention tracking |
| Brand24 | ChatGPT, Perplexity, Claude, Gemini | Multi-platform analysis |
| SE Ranking | Google AI Overviews, ChatGPT, Gemini | Share of voice tracking |
| Keyword.com | Google AI Overviews, ChatGPT, Perplexity | Optimization suggestions |
| BrandBeacon.ai | ChatGPT, Perplexity | Competitor benchmarking |
| Sight AI | ChatGPT, Claude, Perplexity | Sentiment analysis |
| 工具 | 监控平台 | 核心功能 |
|---|---|---|
| Semrush AI Visibility | ChatGPT、Gemini、Perplexity | 免费层级,提及追踪 |
| Brand24 | ChatGPT、Perplexity、Claude、Gemini | 多平台分析 |
| SE Ranking | Google AI概览、ChatGPT、Gemini | 声量追踪 |
| Keyword.com | Google AI概览、ChatGPT、Perplexity | 优化建议 |
| BrandBeacon.ai | ChatGPT、Perplexity | 竞品基准测试 |
| Sight AI | ChatGPT、Claude、Perplexity | 情感分析 |
Key Metrics to Track
需追踪的关键指标
- Citation frequency: How often your content is cited
- Brand mentions: Unprompted mentions in AI responses
- Referral traffic: Visits from AI search click-throughs
- Share of voice: Your visibility vs competitors
- Sentiment: Positive/negative context of mentions
- 引用频率: 内容被引用的次数
- 品牌提及: AI回复中自发提及的次数
- 推荐流量: AI搜索点击带来的访问量
- 声量: 你的可见性与竞品对比
- 情感: 提及的正面/负面语境
Manual Testing Protocol
手动测试协议
markdown
undefinedmarkdown
undefinedMonthly AI Visibility Audit
每月AI可见性审计
Test Queries (adapt to your niche)
测试查询(适配你的领域)
- "What is [your product/service]?"
- "Best [your category] in [year]"
- "[Your brand] vs [competitor]"
- "How to [task your product solves]"
- "[Your expertise area] best practices"
- "What is [your product/service]?"
- "Best [your category] in [year]"
- "[Your brand] vs [competitor]"
- "How to [task your product solves]"
- "[Your expertise area] best practices"
Platforms to Test
测试平台
- ChatGPT (chat.openai.com)
- Perplexity (perplexity.ai)
- Google (check for AI Overviews)
- Microsoft Copilot (copilot.microsoft.com)
- Claude (claude.ai)
- ChatGPT (chat.openai.com)
- Perplexity (perplexity.ai)
- Google(检查AI概览)
- Microsoft Copilot (copilot.microsoft.com)
- Claude (claude.ai)
Record for Each Query
为每个查询记录
- Were you cited? (Yes/No)
- Citation context (positive/neutral/negative)
- Competitors mentioned
- Information accuracy
- Suggested improvements
undefined- 是否被引用?(是/否)
- 引用语境(正面/中性/负面)
- 提及的竞品
- 信息准确性
- 建议改进点
undefined10. AI Search Optimization Checklist
10. AI搜索优化检查清单
Content Structure
内容结构
- Clear H1 with primary topic/question
- Logical heading hierarchy (H1 > H2 > H3)
- Direct answer in first 1-2 sentences
- Bullet points and numbered lists
- Comparison tables where applicable
- Definition lists for terminology
- 清晰的H1(包含核心主题/问题)
- 合理的标题层级(H1 > H2 > H3)
- 开头1-2句直接回答
- 项目符号和编号列表
- 适用时使用对比表格
- 术语定义列表
Technical Implementation
技术实现
- Semantic HTML5 elements (article, section, aside)
- FAQPage schema on Q&A content
- HowTo schema on instructional content
- Article schema with author info
- Organization schema on about pages
- robots.txt allows AI crawlers
- XML sitemap updated and submitted
- HTML5语义化元素(article、section、aside)
- 问答内容使用FAQPage Schema
- 教程内容使用HowTo Schema
- 带作者信息的Article Schema
- 关于页面使用Organization Schema
- robots.txt允许AI爬虫
- XML站点地图已更新并提交
Authority Signals
权威性信号
- Detailed author bios with credentials
- Links to author social profiles
- Citations to authoritative sources
- Visible publication and update dates
- HTTPS enabled
- Contact information accessible
- Privacy policy present
- 带资质的详细作者简介
- 作者社交资料链接
- 权威来源引用
- 可见的发布和更新日期
- 启用HTTPS
- 可访问的联系信息
- 隐私政策存在
Content Quality
内容质量
- Original, expert-level content
- Factual claims supported by sources
- Regular updates (at least monthly)
- Addresses conversational queries
- Includes relevant images with alt text
- Mobile-responsive design
- 原创、专业级内容
- 事实声明有来源支持
- 定期更新(至少每月)
- 覆盖对话式查询
- 包含相关图片及alt文本
- 移动端响应式设计
Monitoring
监控
- AI visibility monitoring tool configured
- Monthly manual query testing
- Competitor citation tracking
- Referral traffic analysis
- Content refresh schedule maintained
- 配置AI可见性监控工具
- 每月手动查询测试
- 竞品引用追踪
- 推荐流量分析
- 内容更新计划已维护
11. Platform-Specific Optimization
11. 平台特定优化
Google AI Overviews
Google AI概览
- Pages with schema are up to 40% more likely to appear in AI Overviews
- Focus on featured snippet optimization (still relevant)
- Emphasize E-E-A-T signals
- Target informational and comparison queries
- 带Schema的页面在AI概览中出现的概率最高提升40%
- 重点优化特色摘要(仍相关)
- 强调E-E-A-T信号
- 针对信息类和对比类查询
Perplexity AI
Perplexity AI
- Freshness is critical - update content every 2-3 days for trending topics
- Real-time citations from current sources
- Prefer authoritative domains
- Include unique images and data
- 新鲜度至关重要 - 热门话题每2-3天更新内容
- 来自当前来源的实时引用
- 偏好权威域名
- 包含独特图片和数据
ChatGPT Search
ChatGPT搜索
- Web browsing uses GPTBot and ChatGPT-User
- Emphasizes recent, authoritative content
- Good at following citations and references
- Benefits from clear, structured content
- 网页浏览使用GPTBot和ChatGPT-User
- 强调最新、权威内容
- 擅长追踪引用和参考资料
- 受益于清晰、结构化内容
Microsoft Copilot
Microsoft Copilot
- Built on Bing index
- Strong integration with Microsoft ecosystem
- Emphasizes factual, well-sourced content
- Benefits from Bing Webmaster Tools optimization
- 基于Bing索引构建
- 与Microsoft生态系统深度集成
- 强调事实准确、来源可靠的内容
- 受益于Bing网站管理员工具优化
12. Future-Proofing Your AI Search Strategy
12. 未来适配AI搜索策略
Emerging Trends
新兴趋势
- Multimodal search: AI understanding images, video, audio
- Conversational commerce: AI-driven purchase decisions
- Personalized AI responses: Context-aware answer customization
- Agent-based search: AI agents completing tasks autonomously
- Real-time fact-checking: AI validating claims before citation
- 多模态搜索: AI理解图片、视频、音频
- 对话式商务: AI驱动的购买决策
- 个性化AI回复: 上下文感知的答案定制
- 基于Agent的搜索: AI代理自主完成任务
- 实时事实核查: AI在引用前验证声明
Adaptation Strategy
适配策略
markdown
undefinedmarkdown
undefinedQuarterly Review Checklist
季度回顾检查清单
AI Platform Updates
AI平台更新
- Review new AI search features from major platforms
- Update robots.txt for new AI bot user agents
- Test visibility on new/emerging AI platforms
- 回顾主流平台的新AI搜索功能
- 为新AI爬虫更新robots.txt
- 在新/新兴AI平台测试可见性
Content Strategy
内容策略
- Analyze which content types get most citations
- Identify gaps in AI coverage vs competitors
- Plan new content for underserved queries
- 分析哪种内容类型获得最多引用
- 识别AI覆盖与竞品的差距
- 为未覆盖的查询规划新内容
Technical Updates
技术更新
- Review schema.org for new relevant types
- Update structured data implementation
- Test page speed and Core Web Vitals
---- 回顾schema.org的新相关类型
- 更新结构化数据实现
- 测试页面速度和核心Web指标
---13. TYPO3 Implementation Guide
13. TYPO3实施指南
Compatibility: TYPO3 v13.x and v14.x (v14 preferred) All configurations in this section work on both v13 and v14.
This section covers TYPO3-specific implementation of AEO/GEO strategies using TYPO3 extensions, configuration, and best practices.
兼容性: TYPO3 v13.x和v14.x(推荐v14) 本节所有配置在v13和v14上均适用。
本节涵盖使用TYPO3扩展、配置和最佳实践,在TYPO3中实施AEO/GEO策略。
Installation Mode: Composer vs Classic
安装模式:Composer vs 经典模式
⚠️ Composer Mode Highly RecommendedFor AI search optimization, Composer-based TYPO3 installations are strongly recommended. All extensions in this guide are available via both Composer (Packagist) and TER (Classic Mode).
⚠️ 强烈推荐Composer模式对于AI搜索优化,强烈推荐基于Composer的TYPO3安装。 本指南中的所有扩展均可通过Composer(Packagist)和TER(经典模式)获取。
Why Composer Mode is Essential for Modern TYPO3
为什么Composer模式对现代TYPO3至关重要
| Aspect | Composer Mode | Classic Mode |
|---|---|---|
| Dependency Resolution | Automatic with version constraints | Manual, no transitive dependencies |
| Autoloading | PSR-4 optimized, production-ready | TYPO3 internal, less optimized |
| Security | Separate web root ( | All files in web root |
| Updates | Single command: | Manual download/upload per extension |
| Reproducibility | | No version locking mechanism |
| TYPO3 v14 Future | Fully supported | Requires |
| 维度 | Composer模式 | 经典模式 |
|---|---|---|
| 依赖解析 | 自动带版本约束 | 手动,无传递依赖 |
| 自动加载 | PSR-4优化,生产就绪 | TYPO3内部实现,优化程度较低 |
| 安全性 | 独立网站根目录( | 所有文件在网站根目录 |
| 更新 | 单条命令: | 手动下载/上传每个扩展 |
| 可重复性 | | 无版本锁定机制 |
| TYPO3 v14未来 | 完全支持 | 所有扩展需 |
Technical Explanation
技术说明
Composer Mode uses PHP's standard dependency manager to:
-
Resolve Dependencies Automatically: Extensions likedepend on
brotkrueml/schemaand other packages. Composer resolves the entire dependency tree, ensuring compatible versions are installed.psr/http-message -
Generate Optimized Autoloaders: Composer creates a PSR-4 compliant autoloader that loads classes on-demand, improving performance compared to TYPO3's legacy class loading.
-
Enforce Version Constraints: Theconstraint
composer.jsonguarantees only compatible versions are installed."typo3/cms-core": "^13.4 || ^14.0" -
Enable Security Isolation: The recommended structure places,
vendor/, and other sensitive directories outside the web-accessibleconfig/folder./public -
Support Modern Workflows: CI/CD pipelines, automated testing, and deployment tools expect Composer-based projects.
TYPO3 v14 Breaking Change: In TYPO3 v14, even Classic Mode requires every extension to have a valid with proper and definitions. Extensions without this file will not be detected.
composer.jsontypeextension-keyjson
// Required composer.json structure for all extensions (v14+)
{
"name": "vendor/extension-key",
"type": "typo3-cms-extension",
"extra": {
"typo3/cms": {
"extension-key": "extension_key"
}
}
}Composer模式使用PHP标准依赖管理器实现:
-
自动解析依赖: 像这样的扩展依赖
brotkrueml/schema及其他包。Composer会解析整个依赖树,确保安装兼容版本。psr/http-message -
生成优化的自动加载器: Composer创建符合PSR-4标准的自动加载器,按需加载类,比TYPO3的传统类加载性能更优。
-
强制版本约束:中的约束
composer.json确保仅安装兼容版本。"typo3/cms-core": "^13.4 || ^14.0" -
启用安全隔离: 推荐的结构将、
vendor/等敏感目录置于可访问的config/文件夹之外。/public -
支持现代工作流: CI/CD流水线、自动化测试和部署工具均期望基于Composer的项目。
TYPO3 v14重大变更: 在TYPO3 v14中,即使是经典模式也要求所有扩展拥有有效的,包含正确的和定义。无此文件的扩展将无法被检测到。
composer.jsontypeextension-keyjson
// 所有扩展所需的composer.json结构(v14+)
{
"name": "vendor/extension-key",
"type": "typo3-cms-extension",
"extra": {
"typo3/cms": {
"extension-key": "extension_key"
}
}
}Extension Compatibility Matrix
扩展兼容性矩阵
| Extension | TYPO3 v13 | TYPO3 v14 | PHP | Composer | TER | Purpose |
|---|---|---|---|---|---|---|
| ✓ | ✓ | 8.2+ | ✓ | ✓ | Core SEO (meta tags, sitemaps, canonicals) |
| ✓ (v4.x) | ✓ (v4.x) | 8.2+ | ✓ | ✓ | Schema.org structured data (JSON-LD) |
| ✓ | ✗ | 8.1+ | ✓ | ✓ | Content analysis, readability (v13 only) |
| ✓ (v9.3+) | ✓ (v9.3+) | 8.2+ | ✓ | ✓ | Extended SEO features, evaluations |
| 扩展 | TYPO3 v13 | TYPO3 v14 | PHP | Composer | TER | 用途 |
|---|---|---|---|---|---|---|
| ✓ | ✓ | 8.2+ | ✓ | ✓ | 核心SEO(元标签、站点地图、规范URL) |
| ✓(v4.x) | ✓(v4.x) | 8.2+ | ✓ | ✓ | Schema.org结构化数据(JSON-LD) |
| ✓ | ✗ | 8.1+ | ✓ | ✓ | 内容分析、可读性(仅v13) |
| ✓(v9.3+) | ✓(v9.3+) | 8.2+ | ✓ | ✓ | 扩展SEO功能、评估 |
13.1 Required Extensions Installation
13.1 必要扩展安装
Composer Mode (Recommended)
Composer模式(推荐)
bash
undefinedbash
undefinedCore SEO extension (meta tags, sitemaps, canonicals)
核心SEO扩展(元标签、站点地图、规范URL)
ddev composer require typo3/cms-seo
ddev composer require typo3/cms-seo
Schema.org structured data (essential for AI search)
Schema.org结构化数据(AI搜索必备)
Version constraint ensures v13/v14 compatibility
版本约束确保v13/v14兼容性
ddev composer require brotkrueml/schema:"^4.2"
ddev composer require brotkrueml/schema:"^4.2"
Optional: Extended SEO features (v13/v14 compatible)
可选:扩展SEO功能(v13/v14兼容)
ddev composer require clickstorm/cs_seo:"^9.3"
ddev composer require clickstorm/cs_seo:"^9.3"
In Composer mode, extensions are auto-activated
Composer模式下,扩展自动激活
Verify installation:
验证安装:
ddev typo3 extension:list | grep -E "seo|schema"
**Version Constraints Explained:**
```json
{
"require": {
"typo3/cms-seo": "^13.4 || ^14.0",
"brotkrueml/schema": "^4.2"
}
}- = Any version ≥4.2.0 and <5.0.0 (allows minor/patch updates)
^4.2 - = Supports both TYPO3 v13.4+ and v14.0+
^13.4 || ^14.0
ddev typo3 extension:list | grep -E "seo|schema"
**版本约束说明:**
```json
{
"require": {
"typo3/cms-seo": "^13.4 || ^14.0",
"brotkrueml/schema": "^4.2"
}
}- = 所有≥4.2.0且<5.0.0的版本(允许小版本/补丁更新)
^4.2 - = 支持TYPO3 v13.4+和v14.0+
^13.4 || ^14.0
Classic Mode (TER)
经典模式(TER)
Note: Classic Mode is supported but not recommended. TYPO3 v14 requires all extensions to have a valideven in Classic Mode.composer.json
-
Download from TER:
-
Install via Extension Manager:
- Backend → Admin Tools → Extensions
- Click "Upload Extension" or use "Get Extensions" to search TER
- Activate each extension after upload
-
Verify Installation:
- Check Admin Tools → Extensions for active status
- Clear all caches after activation
注意: 支持经典模式但不推荐。TYPO3 v14要求 即使在经典模式下,所有扩展也必须拥有有效的。composer.json
-
从TER下载:
-
通过扩展管理器安装:
- 后端 → 管理工具 → 扩展
- 点击“上传扩展”或使用“获取扩展”搜索TER
- 上传后激活每个扩展
-
验证安装:
- 检查管理工具 → 扩展的激活状态
- 激活后清除所有缓存
13.2 Robots.txt Configuration for AI Bots
13.2 针对AI爬虫的Robots.txt配置
Configure robots.txt via TYPO3's static routes to allow AI crawlers:
yaml
undefined通过TYPO3的静态路由配置robots.txt,允许AI爬虫:
yaml
undefinedconfig/sites/main/config.yaml
config/sites/main/config.yaml
routes:
-
route: robots.txt type: staticText content: |
Standard search engines
User-agent: Googlebot Allow: /User-agent: Bingbot Allow: /OpenAI (ChatGPT)
User-agent: GPTBot Allow: /User-agent: ChatGPT-User Allow: /Perplexity AI
User-agent: PerplexityBot Allow: /Anthropic (Claude)
User-agent: ClaudeBot Allow: /User-agent: anthropic-ai Allow: /Google AI (Gemini)
User-agent: Google-Extended Allow: /Meta AI
User-agent: FacebookBot Allow: /Common Crawl (used by many AI systems)
User-agent: CCBot Allow: /Default
User-agent: * Allow: / Disallow: /typo3/ Disallow: /typo3conf/ Disallow: /typo3temp/Sitemap: https://example.com/sitemap.xml
undefinedroutes:
-
route: robots.txt type: staticText content: |
标准搜索引擎
User-agent: Googlebot Allow: /User-agent: Bingbot Allow: /OpenAI (ChatGPT)
User-agent: GPTBot Allow: /User-agent: ChatGPT-User Allow: /Perplexity AI
User-agent: PerplexityBot Allow: /Anthropic (Claude)
User-agent: ClaudeBot Allow: /User-agent: anthropic-ai Allow: /Google AI (Gemini)
User-agent: Google-Extended Allow: /Meta AI
User-agent: FacebookBot Allow: /Common Crawl(被众多AI系统使用)
User-agent: CCBot Allow: /默认
User-agent: * Allow: / Disallow: /typo3/ Disallow: /typo3conf/ Disallow: /typo3temp/
undefined13.3 Schema.org Implementation with EXT:schema
13.3 使用EXT:schema实现Schema.org
Installation and Setup
安装与设置
bash
ddev composer require brotkrueml/schema:"^4.2"
ddev typo3 extension:activate schemaInclude the static TypoScript template in your site package.
bash
ddev composer require brotkrueml/schema:"^4.2"
ddev typo3 extension:activate schema在站点包中包含静态TypoScript模板。
FAQPage Schema via Fluid ViewHelper
通过Fluid ViewHelper实现FAQPage Schema
html
{namespace schema=Brotkrueml\Schema\ViewHelpers}
<schema:type.fAQPage>
<f:for each="{faqItems}" as="faq">
<schema:type.question -as="mainEntity" name="{faq.question}">
<schema:type.answer -as="acceptedAnswer" text="{faq.answer}" />
</schema:type.question>
</f:for>
</schema:type.fAQPage>html
{namespace schema=Brotkrueml\Schema\ViewHelpers}
<schema:type.fAQPage>
<f:for each="{faqItems}" as="faq">
<schema:type.question -as="mainEntity" name="{faq.question}">
<schema:type.answer -as="acceptedAnswer" text="{faq.answer}" />
</schema:type.question>
</f:for>
</schema:type.fAQPage>Article Schema via Fluid ViewHelper
通过Fluid ViewHelper实现Article Schema
html
{namespace schema=Brotkrueml\Schema\ViewHelpers}
<schema:type.article
-id="https://example.com/article/{article.uid}"
headline="{article.title}"
description="{article.teaser}"
datePublished="{article.crdate -> f:format.date(format: 'c')}"
dateModified="{article.tstamp -> f:format.date(format: 'c')}"
>
<schema:type.person -as="author"
name="{article.author.name}"
url="{article.author.profileUrl}"
>
<schema:property -as="sameAs" value="{article.author.linkedIn}" />
<schema:property -as="sameAs" value="{article.author.twitter}" />
</schema:type.person>
<schema:type.organization -as="publisher"
name="{settings.siteName}"
url="{settings.siteUrl}"
>
<schema:type.imageObject -as="logo" url="{settings.logoUrl}" />
</schema:type.organization>
</schema:type.article>html
{namespace schema=Brotkrueml\Schema\ViewHelpers}
<schema:type.article
-id="https://example.com/article/{article.uid}"
headline="{article.title}"
description="{article.teaser}"
datePublished="{article.crdate -> f:format.date(format: 'c')}"
dateModified="{article.tstamp -> f:format.date(format: 'c')}"
>
<schema:type.person -as="author"
name="{article.author.name}"
url="{article.author.profileUrl}"
>
<schema:property -as="sameAs" value="{article.author.linkedIn}" />
<schema:property -as="sameAs" value="{article.author.twitter}" />
</schema:type.person>
<schema:type.organization -as="publisher"
name="{settings.siteName}"
url="{settings.siteUrl}"
>
<schema:type.imageObject -as="logo" url="{settings.logoUrl}" />
</schema:type.organization>
</schema:type.article>HowTo Schema via Fluid ViewHelper
通过Fluid ViewHelper实现HowTo Schema
html
{namespace schema=Brotkrueml\Schema\ViewHelpers}
<schema:type.howTo
name="How to Optimize Content for AI Search"
description="Step-by-step guide to improving visibility in AI-powered search engines"
>
<f:for each="{steps}" as="step" iteration="iter">
<schema:type.howToStep -as="step"
name="{step.title}"
text="{step.description}"
position="{iter.cycle}"
/>
</f:for>
</schema:type.howTo>html
{namespace schema=Brotkrueml\Schema\ViewHelpers}
<schema:type.howTo
name="How to Optimize Content for AI Search"
description="Step-by-step guide to improving visibility in AI-powered search engines"
>
<f:for each="{steps}" as="step" iteration="iter">
<schema:type.howToStep -as="step"
name="{step.title}"
text="{step.description}"
position="{iter.cycle}"
/>
</f:for>
</schema:type.howTo>Organization Schema via PHP API (PSR-14 Event)
通过PHP API(PSR-14事件)实现Organization Schema
php
<?php
declare(strict_types=1);
namespace Vendor\SitePackage\EventListener;
use Brotkrueml\Schema\Event\RenderAdditionalTypesEvent;
use Brotkrueml\Schema\Type\TypeFactory;
use TYPO3\CMS\Core\Attribute\AsEventListener;
#[AsEventListener(identifier: 'site-package/add-organization-schema')]
final readonly class AddOrganizationSchema
{
public function __construct(
private TypeFactory $typeFactory,
) {}
public function __invoke(RenderAdditionalTypesEvent $event): void
{
$organization = $this->typeFactory->create('Organization')
->setProperty('name', 'Your Company Name')
->setProperty('url', 'https://example.com')
->setProperty('logo', 'https://example.com/logo.png')
->setProperty('description', 'Brief company description for AI understanding')
->setProperty('sameAs', [
'https://www.linkedin.com/company/yourcompany',
'https://twitter.com/yourcompany',
'https://github.com/yourcompany',
]);
$contactPoint = $this->typeFactory->create('ContactPoint')
->setProperty('telephone', '+43-1-234567')
->setProperty('contactType', 'customer service')
->setProperty('availableLanguage', ['German', 'English']);
$organization->setProperty('contactPoint', $contactPoint);
$event->addType($organization);
}
}php
<?php
declare(strict_types=1);
namespace Vendor\SitePackage\EventListener;
use Brotkrueml\Schema\Event\RenderAdditionalTypesEvent;
use Brotkrueml\Schema\Type\TypeFactory;
use TYPO3\CMS\Core\Attribute\AsEventListener;
#[AsEventListener(identifier: 'site-package/add-organization-schema')]
final readonly class AddOrganizationSchema
{
public function __construct(
private TypeFactory $typeFactory,
) {}
public function __invoke(RenderAdditionalTypesEvent $event): void
{
$organization = $this->typeFactory->create('Organization')
->setProperty('name', 'Your Company Name')
->setProperty('url', 'https://example.com')
->setProperty('logo', 'https://example.com/logo.png')
->setProperty('description', 'Brief company description for AI understanding')
->setProperty('sameAs', [
'https://www.linkedin.com/company/yourcompany',
'https://twitter.com/yourcompany',
'https://github.com/yourcompany',
]);
$contactPoint = $this->typeFactory->create('ContactPoint')
->setProperty('telephone', '+43-1-234567')
->setProperty('contactType', 'customer service')
->setProperty('availableLanguage', ['German', 'English']);
$organization->setProperty('contactPoint', $contactPoint);
$event->addType($organization);
}
}Dynamic Article Schema via PSR-14 Event
通过PSR-14事件实现动态Article Schema
php
<?php
declare(strict_types=1);
namespace Vendor\SitePackage\EventListener;
use Brotkrueml\Schema\Event\RenderAdditionalTypesEvent;
use Brotkrueml\Schema\Type\TypeFactory;
use TYPO3\CMS\Core\Attribute\AsEventListener;
#[AsEventListener(identifier: 'site-package/add-article-schema')]
final readonly class AddArticleSchema
{
public function __construct(
private TypeFactory $typeFactory,
) {}
public function __invoke(RenderAdditionalTypesEvent $event): void
{
$request = $event->getRequest();
$pageInformation = $request->getAttribute('frontend.page.information');
$page = $pageInformation->getPageRecord();
// Only add Article schema for specific doktypes (e.g., 1 = standard page)
if ((int)$page['doktype'] !== 1) {
return;
}
$article = $this->typeFactory->create('Article')
->setProperty('headline', $page['title'])
->setProperty('description', $page['description'] ?: $page['abstract'])
->setProperty('datePublished', date('c', $page['crdate']))
->setProperty('dateModified', date('c', $page['tstamp']));
// Add author if available
if (!empty($page['author'])) {
$author = $this->typeFactory->create('Person')
->setProperty('name', $page['author']);
$article->setProperty('author', $author);
}
$event->addType($article);
}
}php
<?php
declare(strict_types=1);
namespace Vendor\SitePackage\EventListener;
use Brotkrueml\Schema\Event\RenderAdditionalTypesEvent;
use Brotkrueml\Schema\Type\TypeFactory;
use TYPO3\CMS\Core\Attribute\AsEventListener;
#[AsEventListener(identifier: 'site-package/add-article-schema')]
final readonly class AddArticleSchema
{
public function __construct(
private TypeFactory $typeFactory,
) {}
public function __invoke(RenderAdditionalTypesEvent $event): void
{
$request = $event->getRequest();
$pageInformation = $request->getAttribute('frontend.page.information');
$page = $pageInformation->getPageRecord();
// 仅为特定文档类型添加Article Schema(如1=标准页面)
if ((int)$page['doktype'] !== 1) {
return;
}
$article = $this->typeFactory->create('Article')
->setProperty('headline', $page['title'])
->setProperty('description', $page['description'] ?: $page['abstract'])
->setProperty('datePublished', date('c', $page['crdate']))
->setProperty('dateModified', date('c', $page['tstamp']));
// 若有作者则添加
if (!empty($page['author'])) {
$author = $this->typeFactory->create('Person')
->setProperty('name', $page['author']);
$article->setProperty('author', $author);
}
$event->addType($article);
}
}13.4 Content Freshness with Last Modified Headers
13.4 使用最后修改头实现内容新鲜度
TypoScript Configuration
TypoScript配置
typoscript
undefinedtyposcript
undefinedExpose last modified date in HTTP headers
在HTTP头中暴露最后修改日期
config {
sendCacheHeaders = 1
additionalHeaders {
10 {
header = X-Content-Last-Modified
value = TEXT
value.data = page:SYS_LASTCHANGED
value.strftime = %Y-%m-%dT%H:%M:%S%z
}
}
}
config {
sendCacheHeaders = 1
additionalHeaders {
10 {
header = X-Content-Last-Modified
value = TEXT
value.data = page:SYS_LASTCHANGED
value.strftime = %Y-%m-%dT%H:%M:%S%z
}
}
}
Display last updated date in content
在内容中显示最后更新日期
lib.lastModified = TEXT
lib.lastModified {
data = page:SYS_LASTCHANGED
strftime = %B %d, %Y
wrap = <time datetime="|" itemprop="dateModified">Last updated: |</time>
}
undefinedlib.lastModified = TEXT
lib.lastModified {
data = page:SYS_LASTCHANGED
strftime = %B %d, %Y
wrap = <time datetime="|" itemprop="dateModified">最后更新:|</time>
}
undefinedFluid Template for Visible Timestamps
用于可见时间戳的Fluid模板
html
<article itemscope itemtype="https://schema.org/Article">
<header>
<h1 itemprop="headline">{page.title}</h1>
<div class="article-meta">
<time datetime="{page.crdate -> f:format.date(format: 'c')}" itemprop="datePublished">
Published: <f:format.date format="F j, Y">{page.crdate}</f:format.date>
</time>
<time datetime="{page.SYS_LASTCHANGED -> f:format.date(format: 'c')}" itemprop="dateModified">
Last Updated: <f:format.date format="F j, Y">{page.SYS_LASTCHANGED}</f:format.date>
</time>
</div>
</header>
<!-- Content -->
</article>html
<article itemscope itemtype="https://schema.org/Article">
<header>
<h1 itemprop="headline">{page.title}</h1>
<div class="article-meta">
<time datetime="{page.crdate -> f:format.date(format: 'c')}" itemprop="datePublished">
发布于:<f:format.date format="F j, Y">{page.crdate}</f:format.date>
</time>
<time datetime="{page.SYS_LASTCHANGED -> f:format.date(format: 'c')}" itemprop="dateModified">
最后更新:<f:format.date format="F j, Y">{page.SYS_LASTCHANGED}</f:format.date>
</time>
</div>
</header>
<!-- 内容 -->
</article>13.5 Author Bio Schema for E-E-A-T
13.5 用于E-E-A-T的作者简介Schema
TCA Extension for Author Fields
作者字段的TCA扩展
php
<?php
// Configuration/TCA/Overrides/pages.php
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
$additionalColumns = [
'tx_sitepackage_author_name' => [
'label' => 'Author Name',
'config' => [
'type' => 'input',
'size' => 50,
'max' => 255,
],
],
'tx_sitepackage_author_title' => [
'label' => 'Author Title/Credentials',
'config' => [
'type' => 'input',
'size' => 50,
'max' => 255,
],
],
'tx_sitepackage_author_bio' => [
'label' => 'Author Bio',
'config' => [
'type' => 'text',
'rows' => 5,
],
],
'tx_sitepackage_author_linkedin' => [
'label' => 'Author LinkedIn URL',
'config' => [
'type' => 'link',
'allowedTypes' => ['url'],
],
],
];
ExtensionManagementUtility::addTCAcolumns('pages', $additionalColumns);
ExtensionManagementUtility::addToAllTCAtypes(
'pages',
'--div--;Author,tx_sitepackage_author_name,tx_sitepackage_author_title,tx_sitepackage_author_bio,tx_sitepackage_author_linkedin'
);php
<?php
// Configuration/TCA/Overrides/pages.php
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
$additionalColumns = [
'tx_sitepackage_author_name' => [
'label' => '作者姓名',
'config' => [
'type' => 'input',
'size' => 50,
'max' => 255,
],
],
'tx_sitepackage_author_title' => [
'label' => '作者头衔/资质',
'config' => [
'type' => 'input',
'size' => 50,
'max' => 255,
],
],
'tx_sitepackage_author_bio' => [
'label' => '作者简介',
'config' => [
'type' => 'text',
'rows' => 5,
],
],
'tx_sitepackage_author_linkedin' => [
'label' => '作者LinkedIn URL',
'config' => [
'type' => 'link',
'allowedTypes' => ['url'],
],
],
];
ExtensionManagementUtility::addTCAcolumns('pages', $additionalColumns);
ExtensionManagementUtility::addToAllTCAtypes(
'pages',
'--div--;作者,tx_sitepackage_author_name,tx_sitepackage_author_title,tx_sitepackage_author_bio,tx_sitepackage_author_linkedin'
);Author Schema PSR-14 Event Listener
作者Schema的PSR-14事件监听器
php
<?php
declare(strict_types=1);
namespace Vendor\SitePackage\EventListener;
use Brotkrueml\Schema\Event\RenderAdditionalTypesEvent;
use Brotkrueml\Schema\Type\TypeFactory;
use TYPO3\CMS\Core\Attribute\AsEventListener;
#[AsEventListener(identifier: 'site-package/add-author-schema')]
final readonly class AddAuthorSchema
{
public function __construct(
private TypeFactory $typeFactory,
) {}
public function __invoke(RenderAdditionalTypesEvent $event): void
{
$request = $event->getRequest();
$pageInformation = $request->getAttribute('frontend.page.information');
$page = $pageInformation->getPageRecord();
if (empty($page['tx_sitepackage_author_name'])) {
return;
}
$author = $this->typeFactory->create('Person')
->setProperty('name', $page['tx_sitepackage_author_name'])
->setProperty('jobTitle', $page['tx_sitepackage_author_title'] ?? '')
->setProperty('description', $page['tx_sitepackage_author_bio'] ?? '');
if (!empty($page['tx_sitepackage_author_linkedin'])) {
$author->setProperty('sameAs', [$page['tx_sitepackage_author_linkedin']]);
}
$event->addType($author);
}
}php
<?php
declare(strict_types=1);
namespace Vendor\SitePackage\EventListener;
use Brotkrueml\Schema\Event\RenderAdditionalTypesEvent;
use Brotkrueml\Schema\Type\TypeFactory;
use TYPO3\CMS\Core\Attribute\AsEventListener;
#[AsEventListener(identifier: 'site-package/add-author-schema')]
final readonly class AddAuthorSchema
{
public function __construct(
private TypeFactory $typeFactory,
) {}
public function __invoke(RenderAdditionalTypesEvent $event): void
{
$request = $event->getRequest();
$pageInformation = $request->getAttribute('frontend.page.information');
$page = $pageInformation->getPageRecord();
if (empty($page['tx_sitepackage_author_name'])) {
return;
}
$author = $this->typeFactory->create('Person')
->setProperty('name', $page['tx_sitepackage_author_name'])
->setProperty('jobTitle', $page['tx_sitepackage_author_title'] ?? '')
->setProperty('description', $page['tx_sitepackage_author_bio'] ?? '');
if (!empty($page['tx_sitepackage_author_linkedin'])) {
$author->setProperty('sameAs', [$page['tx_sitepackage_author_linkedin']]);
}
$event->addType($author);
}
}13.6 FAQ Content Element with Schema
13.6 带Schema的FAQ内容元素
Content Block Definition (EXT:content_blocks)
内容块定义(EXT:content_blocks)
yaml
undefinedyaml
undefinedContentBlocks/ContentElements/faq-accordion/config.yaml
ContentBlocks/ContentElements/faq-accordion/config.yaml
name: vendor/faq-accordion
typeName: faq_accordion
title: FAQ Accordion
description: FAQ with structured data for AI search
group: common
fields:
- identifier: faq_items
type: Collection
labelField: question
fields:
- identifier: question type: Text required: true
- identifier: answer type: Textarea enableRichtext: true required: true
undefinedname: vendor/faq-accordion
typeName: faq_accordion
title: FAQ手风琴
description: 带AI搜索结构化数据的FAQ
group: common
fields:
- identifier: faq_items
type: Collection
labelField: question
fields:
- identifier: question type: Text required: true
- identifier: answer type: Textarea enableRichtext: true required: true
undefinedFluid Template with Schema
带Schema的Fluid模板
html
<!-- ContentBlocks/ContentElements/faq-accordion/Resources/Private/Frontend.html -->
{namespace schema=Brotkrueml\Schema\ViewHelpers}
<section class="faq-accordion">
<schema:type.fAQPage>
<f:for each="{data.faq_items}" as="item">
<schema:type.question -as="mainEntity" name="{item.question}">
<schema:type.answer -as="acceptedAnswer">
<schema:property -as="text" value="{item.answer -> f:format.stripTags()}" />
</schema:type.answer>
</schema:type.question>
<details class="faq-item">
<summary class="faq-question">{item.question}</summary>
<div class="faq-answer">
<f:format.html>{item.answer}</f:format.html>
</div>
</details>
</f:for>
</schema:type.fAQPage>
</section>html
<!-- ContentBlocks/ContentElements/faq-accordion/Resources/Private/Frontend.html -->
{namespace schema=Brotkrueml\Schema\ViewHelpers}
<section class="faq-accordion">
<schema:type.fAQPage>
<f:for each="{data.faq_items}" as="item">
<schema:type.question -as="mainEntity" name="{item.question}">
<schema:type.answer -as="acceptedAnswer">
<schema:property -as="text" value="{item.answer -> f:format.stripTags()}" />
</schema:type.answer>
</schema:type.question>
<details class="faq-item">
<summary class="faq-question">{item.question}</summary>
<div class="faq-answer">
<f:format.html>{item.answer}</f:format.html>
</div>
</details>
</f:for>
</schema:type.fAQPage>
</section>13.7 Breadcrumb Schema
13.7 面包屑Schema
Fluid ViewHelper Implementation
Fluid ViewHelper实现
html
{namespace schema=Brotkrueml\Schema\ViewHelpers}
<nav aria-label="Breadcrumb">
<schema:type.breadcrumbList>
<f:for each="{breadcrumbs}" as="crumb" iteration="iter">
<schema:type.listItem -as="itemListElement" position="{iter.cycle}">
<schema:property -as="name" value="{crumb.title}" />
<schema:property -as="item" value="{crumb.url}" />
</schema:type.listItem>
</f:for>
</schema:type.breadcrumbList>
<ol class="breadcrumb">
<f:for each="{breadcrumbs}" as="crumb" iteration="iter">
<li class="breadcrumb-item{f:if(condition: iter.isLast, then: ' active')}">
<f:if condition="{iter.isLast}">
<f:then>{crumb.title}</f:then>
<f:else>
<a href="{crumb.url}">{crumb.title}</a>
</f:else>
</f:if>
</li>
</f:for>
</ol>
</nav>html
{namespace schema=Brotkrueml\Schema\ViewHelpers}
<nav aria-label="面包屑">
<schema:type.breadcrumbList>
<f:for each="{breadcrumbs}" as="crumb" iteration="iter">
<schema:type.listItem -as="itemListElement" position="{iter.cycle}">
<schema:property -as="name" value="{crumb.title}" />
<schema:property -as="item" value="{crumb.url}" />
</schema:type.listItem>
</f:for>
</schema:type.breadcrumbList>
<ol class="breadcrumb">
<f:for each="{breadcrumbs}" as="crumb" iteration="iter">
<li class="breadcrumb-item{f:if(condition: iter.isLast, then: ' active')}">
<f:if condition="{iter.isLast}">
<f:then>{crumb.title}</f:then>
<f:else>
<a href="{crumb.url}">{crumb.title}</a>
</f:else>
</f:if>
</li>
</f:for>
</ol>
</nav>13.8 Semantic HTML via Fluid Layouts
13.8 通过Fluid布局实现语义化HTML
html
<!-- Resources/Private/Layouts/Default.html -->
<!DOCTYPE html>
<html lang="{siteLanguage.locale.languageCode}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<f:render section="HeaderAssets" optional="true" />
</head>
<body>
<header role="banner">
<f:render partial="Header" />
</header>
<nav role="navigation" aria-label="Main navigation">
<f:render partial="Navigation/Main" />
</nav>
<main role="main">
<article>
<header>
<h1>{page.title}</h1>
<f:if condition="{page.subtitle}">
<p class="lead">{page.subtitle}</p>
</f:if>
</header>
<section>
<f:render section="Content" />
</section>
</article>
</main>
<aside role="complementary">
<f:render partial="Sidebar" optional="true" />
</aside>
<footer role="contentinfo">
<f:render partial="Footer" />
</footer>
</body>
</html>html
<!-- Resources/Private/Layouts/Default.html -->
<!DOCTYPE html>
<html lang="{siteLanguage.locale.languageCode}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<f:render section="HeaderAssets" optional="true" />
</head>
<body>
<header role="banner">
<f:render partial="Header" />
</header>
<nav role="navigation" aria-label="主导航">
<f:render partial="Navigation/Main" />
</nav>
<main role="main">
<article>
<header>
<h1>{page.title}</h1>
<f:if condition="{page.subtitle}">
<p class="lead">{page.subtitle}</p>
</f:if>
</header>
<section>
<f:render section="Content" />
</section>
</article>
</main>
<aside role="complementary">
<f:render partial="Sidebar" optional="true" />
</aside>
<footer role="contentinfo">
<f:render partial="Footer" />
</footer>
</body>
</html>13.9 TYPO3 AI Search Optimization Checklist
13.9 TYPO3 AI搜索优化检查清单
Extensions & Configuration
扩展与配置
- EXT:seo installed and configured
- EXT:schema (brotkrueml/schema ^4.2) installed
- Static TypoScript templates included
- robots.txt configured via site config with AI bot rules
- 安装并配置EXT:seo
- 安装EXT:schema(brotkrueml/schema ^4.2)
- 包含静态TypoScript模板
- 通过站点配置robots.txt并添加AI爬虫规则
Schema Implementation
Schema实现
- Organization schema on all pages
- Article schema on content pages
- FAQPage schema on FAQ content
- HowTo schema on tutorial content
- BreadcrumbList on all pages
- Author/Person schema with credentials
- 所有页面添加Organization Schema
- 内容页面添加Article Schema
- FAQ内容添加FAQPage Schema
- 教程内容添加HowTo Schema
- 所有页面添加BreadcrumbList
- 带资质的作者/Person Schema
Content Structure
内容结构
- Semantic HTML5 elements in Fluid templates
- Proper heading hierarchy (single H1)
- Visible publication and update dates
- Author bios with credentials
- Alt text on all images via FAL
- Fluid模板中使用HTML5语义化元素
- 正确的标题层级(单个H1)
- 可见的发布和更新日期
- 带资质的作者简介
- 所有图片通过FAL添加alt文本
Technical
技术
- SYS_LASTCHANGED used for content freshness
- Cache headers configured
- XML sitemap via EXT:seo
- Canonical URLs configured
- hreflang for multi-language sites
- 使用SYS_LASTCHANGED实现内容新鲜度
- 配置缓存头
- 通过EXT:seo生成XML站点地图
- 配置规范URL
- 多语言站点配置hreflang
13.10 Debugging Schema Output
13.10 调试Schema输出
Admin Panel Integration
管理面板集成
EXT:schema integrates with TYPO3's Admin Panel. Enable it to see generated JSON-LD:
typoscript
undefinedEXT:schema与TYPO3的管理面板集成。启用后可查看生成的JSON-LD:
typoscript
undefinedconfig/system/settings.php
config/system/settings.php
$GLOBALS['TYPO3_CONF_VARS']['BE']['adminPanel'] = true;
undefined$GLOBALS['TYPO3_CONF_VARS']['BE']['adminPanel'] = true;
undefinedValidation Tools
验证工具
After implementing structured data, validate using:
- Schema Markup Validator: https://validator.schema.org/
- Google Rich Results Test: https://search.google.com/test/rich-results
- Google Search Console: Submit and monitor structured data
实现结构化数据后,使用以下工具验证:
- Schema标记验证器: https://validator.schema.org/
- Google富媒体结果测试: https://search.google.com/test/rich-results
- Google搜索控制台: 提交并监控结构化数据
View Generated JSON-LD
查看生成的JSON-LD
bash
undefinedbash
undefinedFetch page and extract JSON-LD
获取页面并提取JSON-LD
curl -s https://example.com/page | grep -o '<script type="application/ld+json">.*</script>'
---curl -s https://example.com/page | grep -o '<script type="application/ld+json">.*</script>'
---14. Markdown & MDX Implementation
14. Markdown & MDX实施
This section covers AI search optimization for static sites and documentation platforms using Markdown (MD) and MDX.
本节涵盖使用Markdown(MD)和MDX为静态站点和文档平台优化AI搜索。
14.1 Frontmatter for AI Search
14.1 AI搜索用Frontmatter
Use frontmatter to define structured metadata that frameworks can transform into meta tags and structured data:
yaml
---
title: "How to Optimize Content for AI Search Engines"
description: "Complete guide to AEO and GEO strategies for ChatGPT, Perplexity, and Google AI Overviews visibility."
date: 2025-01-15
lastmod: 2025-01-15
author:
name: "Jane Doe"
title: "SEO Specialist"
linkedin: "https://linkedin.com/in/janedoe"
twitter: "https://twitter.com/janedoe"
tags: ["aeo", "geo", "ai-search", "seo"]
category: "SEO"
image: "/images/ai-search-guide.jpg"
schema:
type: "Article"
wordCount: 2500
draft: false
---使用Frontmatter定义结构化元数据,框架可将其转换为元标签和结构化数据:
yaml
---
title: "How to Optimize Content for AI Search Engines"
description: "Complete guide to AEO and GEO strategies for ChatGPT, Perplexity, and Google AI Overviews visibility."
date: 2025-01-15
lastmod: 2025-01-15
author:
name: "Jane Doe"
title: "SEO Specialist"
linkedin: "https://linkedin.com/in/janedoe"
twitter: "https://twitter.com/janedoe"
tags: ["aeo", "geo", "ai-search", "seo"]
category: "SEO"
image: "/images/ai-search-guide.jpg"
schema:
type: "Article"
wordCount: 2500
draft: false
---14.2 Content Structure Best Practices
14.2 内容结构最佳实践
markdown
undefinedmarkdown
undefinedMain Topic as H1 (Single, Contains Primary Question/Keyword)
H1主题(包含核心问题/关键词)
Brief 2-3 sentence summary answering the main question directly.
This paragraph is what AI engines extract first.
开头2-3句直接回答核心问题的摘要。
这部分是AI引擎首先提取的内容。
What is [Topic]?
什么是[主题]?
Direct definition in 1-2 sentences. [Topic] is...
1-2句直接定义。[主题]是...
Key Characteristics
关键特征
- Point 1: Specific, factual information
- Point 2: Verifiable data with source
- Point 3: Actionable insight
- 要点1: 具体、事实性信息
- 要点2: 可验证的数据及来源
- 要点3: 可操作的见解
How Does [Topic] Work?
[主题]如何工作?
Clear process explanation.
- First step with expected outcome
- Second step with verification
- Third step with result
清晰的流程解释。
- 带预期结果的第一步
- 带验证的第二步
- 带结果的第三步
Why is [Topic] Important?
为什么[主题]很重要?
| Benefit | Impact | Evidence |
|---|---|---|
| Benefit 1 | Measurable result | Source/study |
| Benefit 2 | Specific outcome | Data point |
| 优势 | 影响 | 证据 |
|---|---|---|
| 优势1 | 可衡量结果 | 来源/研究 |
| 优势2 | 具体成果 | 数据点 |
Frequently Asked Questions
常见问题
<details>
<summary>Question 1?</summary>
Direct answer to question 1.
</details>
<details>
<summary>Question 2?</summary>
Direct answer to question 2.
</details>
```<details>
<summary>问题1?</summary>
问题1的直接答案。
</details>
<details>
<summary>问题2?</summary>
问题2的直接答案。
</details>
```14.3 JSON-LD in MDX (Next.js / Astro)
14.3 MDX中的JSON-LD(Next.js / Astro)
Next.js App Router
Next.js App Router
tsx
// components/JsonLd.tsx
type JsonLdProps = {
data: Record<string, unknown>;
};
export function JsonLd({ data }: JsonLdProps) {
return (
<script
type="application/ld+json"
dangerouslySetInnerHTML={{
__html: JSON.stringify(data).replace(/</g, '\\u003c'),
}}
/>
);
}mdx
---
title: "AI Search Optimization Guide"
---
import { JsonLd } from '@/components/JsonLd';
<JsonLd data={{
"@context": "https://schema.org",
"@type": "Article",
"headline": "AI Search Optimization Guide",
"author": {
"@type": "Person",
"name": "Jane Doe"
},
"datePublished": "2025-01-15",
"dateModified": "2025-01-15"
}} />tsx
// components/JsonLd.tsx
type JsonLdProps = {
data: Record<string, unknown>;
};
export function JsonLd({ data }: JsonLdProps) {
return (
<script
type="application/ld+json"
dangerouslySetInnerHTML={{
__html: JSON.stringify(data).replace(/</g, '\\u003c'),
}}
/>
);
}mdx
---
title: "AI搜索优化指南"
---
import { JsonLd } from '@/components/JsonLd';
<JsonLd data={{
"@context": "https://schema.org",
"@type": "Article",
"headline": "AI搜索优化指南",
"author": {
"@type": "Person",
"name": "Jane Doe"
},
"datePublished": "2025-01-15",
"dateModified": "2025-01-15"
}} />AI Search Optimization Guide
AI搜索优化指南
Content here...
undefined内容...
undefinedAstro with astro-seo-schema
使用astro-seo-schema的Astro
bash
npm install schema-dts astro-seo-schemaastro
---
// src/layouts/Article.astro
import { Schema } from 'astro-seo-schema';
const { frontmatter } = Astro.props;
---
<html>
<head>
<Schema item={{
"@context": "https://schema.org",
"@type": "Article",
"headline": frontmatter.title,
"description": frontmatter.description,
"author": {
"@type": "Person",
"name": frontmatter.author.name
},
"datePublished": frontmatter.date,
"dateModified": frontmatter.lastmod
}} />
</head>
<body>
<slot />
</body>
</html>bash
npm install schema-dts astro-seo-schemaastro
---
// src/layouts/Article.astro
import { Schema } from 'astro-seo-schema';
const { frontmatter } = Astro.props;
---
<html>
<head>
<Schema item={{
"@context": "https://schema.org",
"@type": "Article",
"headline": frontmatter.title,
"description": frontmatter.description,
"author": {
"@type": "Person",
"name": frontmatter.author.name
},
"datePublished": frontmatter.date,
"dateModified": frontmatter.lastmod
}} />
</head>
<body>
<slot />
</body>
</html>14.4 FAQ Schema Component for MDX
14.4 MDX的FAQ Schema组件
tsx
// components/FAQ.tsx
import { JsonLd } from './JsonLd';
type FAQItem = {
question: string;
answer: string;
};
type FAQProps = {
items: FAQItem[];
};
export function FAQ({ items }: FAQProps) {
const schemaData = {
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": items.map(item => ({
"@type": "Question",
"name": item.question,
"acceptedAnswer": {
"@type": "Answer",
"text": item.answer
}
}))
};
return (
<>
<JsonLd data={schemaData} />
<section className="faq">
{items.map((item, index) => (
<details key={index}>
<summary>{item.question}</summary>
<p>{item.answer}</p>
</details>
))}
</section>
</>
);
}mdx
import { FAQ } from '@/components/FAQ';tsx
// components/FAQ.tsx
import { JsonLd } from './JsonLd';
type FAQItem = {
question: string;
answer: string;
};
type FAQProps = {
items: FAQItem[];
};
export function FAQ({ items }: FAQProps) {
const schemaData = {
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": items.map(item => ({
"@type": "Question",
"name": item.question,
"acceptedAnswer": {
"@type": "Answer",
"text": item.answer
}
}))
};
return (
<>
<JsonLd data={schemaData} />
<section className="faq">
{items.map((item, index) => (
<details key={index}>
<summary>{item.question}</summary>
<p>{item.answer}</p>
</details>
))}
</section>
</>
);
}mdx
import { FAQ } from '@/components/FAQ';Frequently Asked Questions
常见问题
<FAQ items={[
{
question: "What is AEO?",
answer: "Answer Engine Optimization (AEO) is the practice of optimizing content to be cited directly in AI-generated answers."
},
{
question: "How is GEO different from SEO?",
answer: "GEO targets AI-generated search results, while traditional SEO focuses on ranking in link-based search results."
}
]} />
undefined<FAQ items={[
{
question: "什么是AEO?",
answer: "答案引擎优化(AEO)是优化内容以直接在AI生成答案中被引用的实践。"
},
{
question: "GEO与SEO有何不同?",
answer: "GEO针对AI生成的搜索结果,而传统SEO专注于在基于链接的搜索结果中排名。"
}
]} />
undefined14.5 Raw MDX View with URL Parameter
14.5 带URL参数的原始MDX视图
Enable viewing raw MDX source for transparency and AI training accessibility:
启用查看原始MDX源以提升透明度和AI训练可访问性:
Next.js Implementation
Next.js实现
typescript
// next.config.js - Rewrite .md URLs to API
module.exports = {
async rewrites() {
return [
{
source: '/docs/:path*.md',
destination: '/api/raw-mdx?path=:path*',
},
];
},
};typescript
// app/api/raw-mdx/route.ts
import { NextRequest, NextResponse } from 'next/server';
import fs from 'fs';
import path from 'path';
export async function GET(request: NextRequest) {
const searchParams = request.nextUrl.searchParams;
const filePath = searchParams.get('path');
if (!filePath) {
return NextResponse.json({ error: 'Path required' }, { status: 400 });
}
// Prevent directory traversal
const safePath = filePath.replace(/\.\./g, '');
const mdxPath = path.join(process.cwd(), 'content', `${safePath}.mdx`);
try {
const content = fs.readFileSync(mdxPath, 'utf8');
return new NextResponse(content, {
headers: { 'Content-Type': 'text/plain; charset=utf-8' },
});
} catch {
return NextResponse.json({ error: 'Not found' }, { status: 404 });
}
}Usage:
- → Rendered page
/docs/getting-started - → Raw MDX source
/docs/getting-started.md
typescript
// next.config.js - 将.md URL重写为API
module.exports = {
async rewrites() {
return [
{
source: '/docs/:path*.md',
destination: '/api/raw-mdx?path=:path*',
},
];
},
};typescript
// app/api/raw-mdx/route.ts
import { NextRequest, NextResponse } from 'next/server';
import fs from 'fs';
import path from 'path';
export async function GET(request: NextRequest) {
const searchParams = request.nextUrl.searchParams;
const filePath = searchParams.get('path');
if (!filePath) {
return NextResponse.json({ error: '需要路径' }, { status: 400 });
}
// 防止目录遍历
const safePath = filePath.replace(/\.\./g, '');
const mdxPath = path.join(process.cwd(), 'content', `${safePath}.mdx`);
try {
const content = fs.readFileSync(mdxPath, 'utf8');
return new NextResponse(content, {
headers: { 'Content-Type': 'text/plain; charset=utf-8' },
});
} catch {
return NextResponse.json({ error: '未找到' }, { status: 404 });
}
}用法:
- → 渲染页面
/docs/getting-started - → 原始MDX源
/docs/getting-started.md
Query Parameter Alternative
查询参数替代方案
typescript
// app/docs/[...slug]/page.tsx
import { notFound } from 'next/navigation';
import fs from 'fs';
import path from 'path';
type Props = {
params: { slug: string[] };
searchParams: { raw?: string };
};
export default async function Page({ params, searchParams }: Props) {
const slug = params.slug.join('/');
const mdxPath = path.join(process.cwd(), 'content', `${slug}.mdx`);
// Show raw MDX if ?raw=true
if (searchParams.raw === 'true') {
try {
const rawContent = fs.readFileSync(mdxPath, 'utf8');
return (
<article>
<header>
<p className="text-sm text-gray-500">
Raw MDX source • <a href={`/docs/${slug}`}>View rendered</a>
</p>
</header>
<pre className="p-4 bg-gray-50 rounded overflow-auto">
<code>{rawContent}</code>
</pre>
</article>
);
} catch {
notFound();
}
}
// Normal MDX rendering
// ... your MDX processing
}Usage:
- → Rendered page
/docs/getting-started - → Raw MDX source
/docs/getting-started?raw=true
typescript
// app/docs/[...slug]/page.tsx
import { notFound } from 'next/navigation';
import fs from 'fs';
import path from 'path';
type Props = {
params: { slug: string[] };
searchParams: { raw?: string };
};
export default async function Page({ params, searchParams }: Props) {
const slug = params.slug.join('/');
const mdxPath = path.join(process.cwd(), 'content', `${slug}.mdx`);
// 若?raw=true则显示原始MDX
if (searchParams.raw === 'true') {
try {
const rawContent = fs.readFileSync(mdxPath, 'utf8');
return (
<article>
<header>
<p className="text-sm text-gray-500">
原始MDX源 • <a href={`/docs/${slug}`}>查看渲染版</a>
</p>
</header>
<pre className="p-4 bg-gray-50 rounded overflow-auto">
<code>{rawContent}</code>
</pre>
</article>
);
} catch {
notFound();
}
}
// 常规MDX渲染
// ... 你的MDX处理逻辑
}用法:
- → 渲染页面
/docs/getting-started - → 原始MDX源
/docs/getting-started?raw=true
14.6 Automatic Schema Generation from Frontmatter
14.6 从Frontmatter自动生成Schema
typescript
// lib/generateSchema.ts
type Frontmatter = {
title: string;
description: string;
date: string;
lastmod?: string;
author?: {
name: string;
title?: string;
linkedin?: string;
twitter?: string;
};
image?: string;
schema?: {
type?: 'Article' | 'HowTo' | 'FAQPage';
wordCount?: number;
};
};
export function generateSchema(frontmatter: Frontmatter, url: string) {
const schemaType = frontmatter.schema?.type || 'Article';
const baseSchema = {
"@context": "https://schema.org",
"@type": schemaType,
"headline": frontmatter.title,
"description": frontmatter.description,
"url": url,
"datePublished": frontmatter.date,
"dateModified": frontmatter.lastmod || frontmatter.date,
};
if (frontmatter.author) {
const sameAs = [
frontmatter.author.linkedin,
frontmatter.author.twitter,
].filter(Boolean);
baseSchema["author"] = {
"@type": "Person",
"name": frontmatter.author.name,
"jobTitle": frontmatter.author.title,
...(sameAs.length > 0 && { "sameAs": sameAs }),
};
}
if (frontmatter.image) {
baseSchema["image"] = frontmatter.image;
}
if (frontmatter.schema?.wordCount) {
baseSchema["wordCount"] = frontmatter.schema.wordCount;
}
return baseSchema;
}typescript
// lib/generateSchema.ts
type Frontmatter = {
title: string;
description: string;
date: string;
lastmod?: string;
author?: {
name: string;
title?: string;
linkedin?: string;
twitter?: string;
};
image?: string;
schema?: {
type?: 'Article' | 'HowTo' | 'FAQPage';
wordCount?: number;
};
};
export function generateSchema(frontmatter: Frontmatter, url: string) {
const schemaType = frontmatter.schema?.type || 'Article';
const baseSchema = {
"@context": "https://schema.org",
"@type": schemaType,
"headline": frontmatter.title,
"description": frontmatter.description,
"url": url,
"datePublished": frontmatter.date,
"dateModified": frontmatter.lastmod || frontmatter.date,
};
if (frontmatter.author) {
const sameAs = [
frontmatter.author.linkedin,
frontmatter.author.twitter,
].filter(Boolean);
baseSchema["author"] = {
"@type": "Person",
"name": frontmatter.author.name,
"jobTitle": frontmatter.author.title,
...(sameAs.length > 0 && { "sameAs": sameAs }),
};
}
if (frontmatter.image) {
baseSchema["image"] = frontmatter.image;
}
if (frontmatter.schema?.wordCount) {
baseSchema["wordCount"] = frontmatter.schema.wordCount;
}
return baseSchema;
}14.7 MD/MDX AI Search Checklist
14.7 MD/MDX AI搜索优化检查清单
- Frontmatter: Title, description, date, lastmod, author with credentials
- Structure: Single H1, logical heading hierarchy, direct answers first
- Schema: JSON-LD in layout or per-page (Article, FAQPage, HowTo)
- FAQ sections: Use with FAQPage schema
<details>/<summary> - Tables: For comparisons (AI extracts structured data)
- Lists: Bullet points and numbered steps
- Last modified: Visible and in frontmatter
- Author bio: Name, credentials, social links
- Raw view: Optional or
.mdendpoint?raw=true - Images: Alt text, proper dimensions, WebP format
- llms.txt: LLM-friendly site index (see Section 15)
- Frontmatter: 标题、描述、日期、lastmod、带资质的作者
- 结构: 单个H1、合理的标题层级、开头直接回答
- Schema: 布局或每页添加JSON-LD(Article、FAQPage、HowTo)
- FAQ部分: 使用并添加FAQPage Schema
<details>/<summary> - 表格: 用于对比(AI提取结构化数据)
- 列表: 项目符号和编号步骤
- 最后修改: 可见且包含在Frontmatter中
- 作者简介: 姓名、资质、社交链接
- 原始视图: 可选的或
.md端点?raw=true - 图片: alt文本、合适尺寸、WebP格式
- llms.txt: LLM友好的站点索引(见第15节)
15. llms.txt - LLM Site Index
15. llms.txt - LLM站点索引
The standard provides a structured, machine-readable file to help LLMs understand and navigate your website content efficiently.
llms.txtNote: As of late 2025, adoption by major AI companies is still limited, but implementing llms.txt is low-effort and future-proofs your site for AI discovery.
llms.txt注意: 截至2025年末,主要AI公司的采用率仍有限,但实施 llms.txt成本低,可未来适配AI发现。
15.1 What is llms.txt?
15.1 什么是llms.txt?
Similar to for crawlers, is a Markdown file at your site root that:
robots.txtllms.txt- Provides a concise index of key documentation/pages
- Includes descriptions to help LLMs understand content purpose
- Enables AI tools to find relevant content without parsing your entire site
- Supports an optional llms-full.txt with complete documentation
类似于面向爬虫的,是位于站点根目录的Markdown文件,用于:
robots.txtllms.txt- 提供关键文档/页面的简洁索引
- 包含描述以帮助LLM理解内容用途
- 使AI工具无需解析整个网站即可找到相关内容
- 可选支持包含完整文档的llms-full.txt
15.2 Basic llms.txt Format
15.2 基础llms.txt格式
markdown
undefinedmarkdown
undefinedYour Company Name
你的公司名称
Brief one-sentence description of your site/product.
Additional context about the site, target audience, and how to use this index.
站点/产品的简短一句话描述。
关于站点、目标受众及如何使用此索引的额外上下文。
Documentation
文档
- Getting Started: Quick introduction for new users
- API Reference: Complete API documentation with examples
- Configuration Guide: Setup and configuration options
Tutorials
教程
- Building Your First App: Step-by-step beginner guide
- Advanced Patterns: In-depth exploration of features
Optional
可选
- About Us: Company background and team
- Blog: Latest news and articles
- Changelog: Version history and updates
**Key rules:**
- Single H1 (`#`) with site/project name
- Blockquote (`>`) with brief description
- H2 sections (`##`) for content groups
- Links formatted as `[Title](URL): Description`
- `## Optional` section for content LLMs can skip15.3 llms-full.txt - Complete Documentation
15.3 llms-full.txt - 完整文档
For sites with extensive documentation, provide a containing your entire documentation in a single Markdown file:
llms-full.txtmarkdown
undefined对于文档丰富的站点,提供包含完整文档的单Markdown文件:
llms-full.txtmarkdown
undefinedYour Company Documentation
你的公司文档
Complete documentation for Your Company's platform.
你的公司平台的完整文档。
Getting Started
入门指南
[Full content of getting started page...]
[入门指南页面的完整内容...]
API Reference
API参考
Authentication
认证
[Full API auth documentation...]
[完整API认证文档...]
Endpoints
端点
[Full API endpoints documentation...]
[完整API端点文档...]
Configuration
配置
[Full configuration documentation...]
**Use cases:**
- AI coding assistants need full API context
- Complex integrations require complete documentation
- Technical support AI needs comprehensive knowledge base[完整配置文档...]
**用例:**
- AI编码助手需要完整API上下文
- 复杂集成需要完整文档
- 技术支持AI需要全面知识库15.4 TYPO3 Implementation
15.4 TYPO3实现
TYPO3 has a dedicated extension for llms.txt generation:
bash
undefinedTYPO3有专门的扩展用于生成llms.txt:
bash
undefinedInstall the extension (TYPO3 v13+)
安装扩展(TYPO3 v13+)
ddev composer require web-vision/ai-llms-txt
undefinedddev composer require web-vision/ai-llms-txt
undefinedSite Configuration
站点配置
yaml
undefinedyaml
undefinedconfig/sites/main/config.yaml
config/sites/main/config.yaml
imports:
- resource: 'EXT:ai_llms_txt/Configuration/Routes/RouterEnhancer.yaml'
undefinedimports:
- resource: 'EXT:ai_llms_txt/Configuration/Routes/RouterEnhancer.yaml'
undefinedTypoScript Configuration
TypoScript配置
typoscript
undefinedtyposcript
undefinedInclude extension TypoScript
包含扩展TypoScript
@import 'EXT:ai_llms_txt/Configuration/TypoScript/setup.typoscript'
@import 'EXT:ai_llms_txt/Configuration/TypoScript/setup.typoscript'
Custom configuration
自定义配置
plugin.tx_aillmstxt {
settings {
# Pages to include (comma-separated UIDs or "auto")
includePages = auto
# Exclude specific pages
excludePages = 1,2,3
# Include page types
includeDoktypes = 1,4
# Maximum depth
maxDepth = 3
}}
undefinedplugin.tx_aillmstxt {
settings {
# 包含页面(逗号分隔UID或"auto")
includePages = auto
# 排除特定页面
excludePages = 1,2,3
# 包含页面类型
includeDoktypes = 1,4
# 最大深度
maxDepth = 3
}}
undefinedManual llms.txt via Static Route
通过静态路由手动配置llms.txt
For full control, create a static route:
yaml
undefined如需完全控制,创建静态路由:
yaml
undefinedconfig/sites/main/config.yaml
config/sites/main/config.yaml
routes:
-
route: llms.txt type: staticText content: |
Your TYPO3 Site
Enterprise content management and digital experience platform.Main Sections
- Home: Main landing page
- Products: Our product catalog
- Documentation: Technical documentation
- Blog: Latest articles and news
Optional
undefined15.5 Next.js Implementation
15.5 Next.js实现
Static File (Simple)
静态文件(简单)
markdown
<!-- public/llms.txt -->markdown
<!-- public/llms.txt -->Your Next.js App
你的Next.js应用
Modern web application built with Next.js.
基于Next.js构建的现代Web应用。
Pages
页面
- Home: Main landing page
- Documentation: Technical docs
- Blog: Latest articles
undefinedDynamic Generation (App Router)
动态生成(App Router)
typescript
// app/llms.txt/route.ts
import { getDocPages, getBlogPosts } from '@/lib/content';
export async function GET() {
const docs = await getDocPages();
const posts = await getBlogPosts();
const content = `# Your Site Name
> Brief description of your site.typescript
// app/llms.txt/route.ts
import { getDocPages, getBlogPosts } from '@/lib/content';
export async function GET() {
const docs = await getDocPages();
const posts = await getBlogPosts();
const content = `# 你的站点名称
> 站点简短描述。Documentation
文档
${docs.map(doc => ).join('\n')}
- [${doc.title}](/docs/${doc.slug}): ${doc.description}${docs.map(doc => ).join('\n')}
- [${doc.title}](/docs/${doc.slug}): ${doc.description}Blog
博客
${posts.slice(0, 10).map(post => ).join('\n')}
- [${post.title}](/blog/${post.slug}): ${post.excerpt}${posts.slice(0, 10).map(post => ).join('\n')}
- [${post.title}](/blog/${post.slug}): ${post.excerpt}Optional
可选
llms-full.txt Generation
llms-full.txt生成
typescript
// app/llms-full.txt/route.ts
import { getDocPages } from '@/lib/content';
import fs from 'fs';
import path from 'path';
export async function GET() {
const docs = await getDocPages();
let fullContent = `# Complete Documentation
> Full documentation for Your Site.
`;
for (const doc of docs) {
const mdxPath = path.join(process.cwd(), 'content/docs', `${doc.slug}.mdx`);
try {
const content = fs.readFileSync(mdxPath, 'utf8');
// Remove frontmatter
const cleanContent = content.replace(/^---[\s\S]*?---\n/, '');
fullContent += `---\n\n## ${doc.title}\n\n${cleanContent}\n\n`;
} catch {
// Skip if file not found
}
}
return new Response(fullContent, {
headers: {
'Content-Type': 'text/plain; charset=utf-8',
'Cache-Control': 'public, max-age=3600, must-revalidate',
},
});
}typescript
// app/llms-full.txt/route.ts
import { getDocPages } from '@/lib/content';
import fs from 'fs';
import path from 'path';
export async function GET() {
const docs = await getDocPages();
let fullContent = `# 完整文档
> 你的站点完整文档。
`;
for (const doc of docs) {
const mdxPath = path.join(process.cwd(), 'content/docs', `${doc.slug}.mdx`);
try {
const content = fs.readFileSync(mdxPath, 'utf8');
// 移除Frontmatter
const cleanContent = content.replace(/^---[\s\S]*?---\n/, '');
fullContent += `---\n\n## ${doc.title}\n\n${cleanContent}\n\n`;
} catch {
// 跳过未找到的文件
}
}
return new Response(fullContent, {
headers: {
'Content-Type': 'text/plain; charset=utf-8',
'Cache-Control': 'public, max-age=3600, must-revalidate',
},
});
}15.6 Astro Implementation
15.6 Astro实现
Using Integration
使用集成
bash
npm install @waldheimdev/astro-ai-llms-txtjavascript
// astro.config.mjs
import llmsTxt from '@waldheimdev/astro-ai-llms-txt';
export default {
integrations: [
llmsTxt({
projectName: 'Your Project',
description: 'Your project description.',
site: 'https://your-domain.com',
}),
],
};bash
npm install @waldheimdev/astro-ai-llms-txtjavascript
// astro.config.mjs
import llmsTxt from '@waldheimdev/astro-ai-llms-txt';
export default {
integrations: [
llmsTxt({
projectName: '你的项目',
description: '你的项目描述。',
site: 'https://your-domain.com',
}),
],
};Manual API Route
手动API路由
typescript
// src/pages/llms.txt.ts
import { getCollection } from 'astro:content';
import type { APIRoute } from 'astro';
export const GET: APIRoute = async () => {
const docs = await getCollection('docs');
const blog = await getCollection('blog');
const content = `# Your Astro Site
> Static site built with Astro.typescript
// src/pages/llms.txt.ts
import { getCollection } from 'astro:content';
import type { APIRoute } from 'astro';
export const GET: APIRoute = async () => {
const docs = await getCollection('docs');
const blog = await getCollection('blog');
const content = `# 你的Astro站点
> 基于Astro构建的静态站点。Documentation
文档
${docs.map(doc => ).join('\n')}
- [${doc.data.title}](/docs/${doc.slug}): ${doc.data.description}${docs.map(doc => ).join('\n')}
- [${doc.data.title}](/docs/${doc.slug}): ${doc.data.description}Blog
博客
${blog.slice(0, 10).map(post => ).join('\n')}
`;
- [${post.data.title}](/blog/${post.slug}): ${post.data.excerpt}return new Response(content, {
headers: { 'Content-Type': 'text/plain; charset=utf-8' },
});
};
undefined${blog.slice(0, 10).map(post => ).join('\n')}
`;
- [${post.data.title}](/blog/${post.slug}): ${post.data.excerpt}return new Response(content, {
headers: { 'Content-Type': 'text/plain; charset=utf-8' },
});
};
undefined15.7 llms.txt Best Practices
15.7 llms.txt最佳实践
| Aspect | Recommendation |
|---|---|
| File size | Keep under 50KB for efficient parsing |
| Descriptions | Brief, informative (not marketing copy) |
| Links | Use absolute URLs for external consumption |
| Updates | Regenerate on content changes |
| Sections | Group logically (Docs, API, Tutorials, Optional) |
| Optional section | Mark non-essential content LLMs can skip |
| 维度 | 建议 |
|---|---|
| 文件大小 | 保持在50KB以下以提升解析效率 |
| 描述 | 简短、信息丰富(非营销文案) |
| 链接 | 外部使用绝对URL |
| 更新 | 内容变更时重新生成 |
| 章节 | 逻辑分组(文档、API、教程、可选) |
| 可选章节 | 标记LLM可跳过的非必要内容 |
15.8 llms.txt Checklist
15.8 llms.txt检查清单
- llms.txt at site root with structured index
- H1 heading with site/project name
- Blockquote summary describing the site
- Organized sections (Docs, API, Blog, Optional)
- Link descriptions for each URL
- llms-full.txt for documentation-heavy sites (optional)
- Cache headers set appropriately (1 hour recommended)
- UTF-8 encoding with text/plain content type
- llms.txt 位于站点根目录,包含结构化索引
- H1标题 为站点/项目名称
- 块引用摘要 描述站点
- 组织化章节(文档、API、博客、可选)
- 每个URL的链接描述
- 文档密集型站点添加llms-full.txt(可选)
- 设置适当的缓存头(推荐1小时)
- UTF-8编码,text/plain内容类型
Resources & References
资源与参考
Official Documentation
官方文档
Industry Resources
行业资源
Monitoring Tools
监控工具
Credits & Attribution
致谢与署名
This skill synthesizes best practices from industry research by Microsoft Advertising,
Semrush, Ahrefs, and the broader SEO community's work on generative engine optimization.
Key sources:
- Microsoft Advertising: "From Discovery to Influence: A Guide to AEO and GEO"
- Semrush research on AI search content optimization
- Ahrefs analysis of AI impact on SEO
Created by webconsulting.at for the Claude Cursor Skills collection.
本技能综合了Microsoft Advertising、
Semrush、Ahrefs的行业研究,以及SEO社区在生成引擎优化方面的最佳实践。
主要来源:
- Microsoft Advertising: "From Discovery to Influence: A Guide to AEO and GEO"
- Semrush关于AI搜索内容优化的研究
- Ahrefs关于AI对SEO影响的分析
由webconsulting.at为Claude Cursor Skills合集创建。