← 知识整理
出海增长 / 知识整理 · 中文

Googlebot 抓取机制与索引控制完全指南 (URL/Links/Mobile-first/Meta/Testing/AMP)

Googlebot 2 类(Smartphone 主 / Desktop 少)+ 抓取限额(2MB HTML / 64MB PDF / 资源独立计 / 解压前算)+ 验证(reverse DNS)。Google 可索引的全部文件类型(flat / encoded / media)。URL structure 6 best practice + 4 大常见问题(faceted / 参数滥用 / 日历无限空间 / 相对链接)。Links 必须 `<a href>` 才可靠爬,anchor text 5 准则。Mobile-first indexing 3 配置(responsive 优 / dynamic / 分 URL)+ 13 troubleshooting 错误。Meta tag 9 支持 + 4 不支持(meta-keyword/lang/next-prev/nositelinkssearchbox)。Valid HTML <head> 8 元素白名单,iframe/img 会切断后续读取。Troubleshoot crawling 5 步 + soft 404 修复 + If-Modified-Since 304 优化 + 紧急 503/429 降爬。Website testing 不要 cloak / 用 302 + rel=canonical。AMP 概览 + Viewer vs Signed Exchange + 完整移除 3 路径。

资料来源:Google 搜索与 SEO · 本站发布:2026-09-26

SEO搜索引擎自然增长

一句话: Googlebot 怎么爬 / URL 怎么写 / link 怎么写 / mobile-first 怎么配 / meta tag 哪些有用 / valid HTML head 是啥 / 抓取问题怎么诊断 / A/B 测试怎么不破坏 SEO / AMP 怎么用与撤 — 站点抓取/索引层的"基础内功"知识合集。

TL;DR — 9 个核心 do/don't

Do Don't
用 <a href="..."> 真链接 <span href> / routerLink / 纯 onclick
URL 用 hyphens 分词(green-dress) underscore(green_dress)
URL 大小写一致 /APPLE 和 /apple 是两个不同 URL
Mobile site 和 desktop 同等内容 移动版精简内容(Google 只看 mobile)
<head> 里只用 8 个白名单标签 塞 <iframe> / <img> 进 head(切断后续读取)
用 description / viewport 等 9 个支持的 meta 用 meta-keyword(完全无效)
A/B 测试用 302 + rel=canonical 用 301 或 noindex
紧急超载用 503 / 429(< 2 天) 长期 503 → URL 被永久踢出索引
错把 200 status code 返 error 页 = soft 404 Google 标 soft 404 后不索引

Part 1 — Googlebot 是谁,怎么爬

1.1 两个子类

类型 UA token 何时用
Googlebot Smartphone 同 user-agent token 主力 — 多数请求
Googlebot Desktop 同 user-agent token 少数 — 兼容 desktop-only 内容

⚠️ robots.txt 里两者用同一个 token(都是 Googlebot)→ 无法只 block 其中一个。

⚠️ Google mobile-first indexing → 大多数站 主索引来源是 mobile crawler。

1.2 爬取限额

资源 上限
HTML / 文本 首 2MB(解压前)
PDF 首 64MB
资源(CSS / JS / 等) 每个独立 2MB(渲染时单独抓)
Googlebot Image / Video 独立 limit

⚠️ 超过 cutoff → 截断,只用已下载部分。

1.3 抓取频率

  • 一般站 每几秒 1 次 平均
  • 短期可能略高(队列延迟)
  • 服务器扛不住 → reduce crawl rate

1.4 时区

美国 IP 爬时,Googlebot 用 Pacific Time(PT)。日志比对要注意时区换算。

1.5 验证 Googlebot(防 UA 伪造)

UA 容易被冒充,验证方式:

1.6 Block Googlebot 时的 3 个选择

目的 用什么
不让爬这页 robots.txt
不让索引这页 noindex
不让任何人 / 爬虫访问 密码保护

Part 2 — Google 可索引的文件类型

2.1 Flat 文本类(unencoded text)

CSV / KML(Google Earth)/ KMZ / GPX(GPS)/ HTML / SVG / TeX/LaTeX / Text(.txt 等)/ WAP / XML

Source code 也算 text: BAS / C/C++(.c .cc .cpp .cxx .h .hpp)/ C#(.cs)/ Java(.java)/ Perl(.pl)/ Python(.py)

2.2 Encoded 文档类

  • Adobe PDF / PS
  • EPUB 电子书
  • 韩国 Hancom Hanword(.hwp)
  • Microsoft Excel / PowerPoint / Word
  • OpenOffice odp / ods / odt
  • Rich Text RTF

2.3 Media

  • 图: BMP / GIF / JPEG / PNG / WebP / SVG / AVIF(新)
  • 视频: 3GP / 3G2 / ASF / AVI / DivX / M2V / M3U / M3U8 / M4V / MKV / MOV / MP4 / MPEG / OGV / QVT / RAM / RM / VOB / WebM / WMV / XAP

2.4 检测方式

Content-Type HTTP header 优先,缺失 / 错时退到文件扩展名 / 重 parse。

filetype:rtf galway operator 可限定查 RTF 文件含 "galway"。


Part 3 — URL Structure Best Practices ⭐⭐⭐

3.1 硬规则(必守)

规则 说明
遵守 IETF STD 66 reserved 字符必须 percent-encode
不要用 fragment 改内容 #/potatoes 这种 — Google 不支持。JS 改内容用 History API
URL 参数用 = + & 不要用 : / [] / 双逗号
多值用 , 分隔 ?color=purple,pink,salmon

3.2 软规则(推荐)

规则 例
描述性 URL(可读单词) ✅ /wiki/Aviation ❌ /index.php?topic=42&area=3a5ebc944f41
用目标语言 德文站 /lebensmittel/pfefferminz,日文站 /ペパーミント
percent-encode 非 ASCII href 里 /gem%C3%BCse 而非 /gemüse
Hyphen 分词(不是 underscore) ✅ /summer-clothing ❌ /summer_clothing
少参数 去掉不改内容的参数
大小写敏感 /APPLE ≠ /apple — server 不分 case 时统一一种
多区域用 country 编码 example.de 或 example.com/de/

3.3 4 大常见 URL 问题

# 问题 例 修法
1 筛选可加性爆炸 酒店 + 海滩 + 健身房 = 3 维 filter 全组合产生海量 URL faceted navigation 管理
2 无关参数 referral id / sort 参数 / session id 用 cookie 替代 session id;robots.txt block 无关参数 URL
3 无限日历 可点击到 2999 年的日历 未来日期 link 加 nofollow
4 相对链接坏掉 ../../category/stuff 在错误页路径产生无限循环 URL 用 root-relative,不要 parent-relative

✅ Recommended(Google 能解析):

<a href="https://example.com">x</a>
<a href="/products/category/shoes">x</a>
<a href="./products/category/shoes">x</a>
<a href="/products/category/shoes" onclick="...">x</a>  <!-- href 是主,onclick 不重要 -->
<a href="/products/category/shoes" class="...">x</a>

❌ Not recommended(可能不被解析):

<a routerLink="products/category">x</a>      <!-- Angular framework 私有属性 -->
<span href="https://example.com">x</span>     <!-- 不是 <a> 元素 -->
<a onclick="goto('https://example.com')">x</a>  <!-- 没有 href -->
<a href="javascript:goTo('products')">x</a>   <!-- href 是 JS 不是真 URL -->

⚠️ JS 动态插的 link 也行 — 只要最终 HTML 里是 <a href> 形式。

4.2 Anchor text 5 准则

A. 不要空 anchor

❌ <a href="https://example.com/page"></a>

有 title 属性时,Google 会用 title 作 fallback;图作 anchor 时用 alt。

B. 描述性(不要 "Click here")

❌ Click here to learn more
❌ Read more
❌ Learn more about our cheese on our website
❌ We have an article about...

✅ For a full list of cheese available, see the list of cheese types

自检: 把 anchor text 单独读,知不知道点进去是啥?不知道 = 太泛。

C. 简洁

❌ <a>Knitted Cow invites local residents of Wisconsin to their grand re-opening by also offering complimentary cow-shaped ice sculptures</a>
✅ <a>Knitted Cow invites local residents of Wisconsin</a> to their grand re-opening...

D. 不要 keyword stuffing

违反 spam policy。

❌ <a>so</a> <a>many</a> <a>times</a> <a>this</a> <a>year</a>

读者难分辨,失去 context。

4.3 内 / 外链 策略

  • 内链: 每个重要页至少有一个其他页指向
  • 外链: 链出去不可怕,引用来源建立可信度。nofollow 只在你不信任对方时用;付费/UGC 用 sponsored/ugc
  • 没有"理想链数",自己觉得太多就是太多

Part 5 — Mobile-First Indexing ⭐⭐⭐

Google 主要用 mobile 版索引和排名。这是 mobile-first。

5.1 3 种 mobile 配置

配置 描述 Google 推荐
Responsive design 同 HTML 同 URL,CSS 决定布局 ⭐ 首选,最易维护
Dynamic serving 同 URL,UA sniffing 返回不同 HTML 需 Vary: user-agent HTTP header
Separate URLs(m-dot) 不同 URL(m.example.com) 最复杂,需 canonical / alternate 配对

5.2 必守 5 大铁律

  1. Mobile 和 desktop 内容必须等价 — 不只视觉,内容文字也要一致。手机版精简 = 索引信号丢失。
  2. Mobile 和 desktop 用相同 robots meta tag — 移动版加 noindex = 整站从 mobile-first 后完全不索引。
  3. 不要 lazy-load 主内容到用户交互后 — Google 不滑屏 / 不点 / 不输入。
  4. structured data 两版都要 — 优先级: Breadcrumb / Product / VideoObject。URL 也得对。
  5. title 和 meta description 两版一致。

5.3 Separate URL 配置详解(m-dot)

canonical 配置

Desktop 版 https://example.com/:

<link rel="canonical" href="https://example.com/">
<link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.example.com/">

Mobile 版 https://m.example.com/:

<link rel="canonical" href="https://example.com/">

核心: desktop 永远是 canonical,mobile 是 alternate。

hreflang 配置(各自指向)

Desktop 版:

<link rel="canonical" href="https://example.com/">
<link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.example.com/">
<link rel="alternate" hreflang="es" href="https://example.com/es/">  <!-- desktop hreflang 指 desktop -->
<link rel="alternate" hreflang="fr" href="https://example.com/fr/">

Mobile 版:

<link rel="canonical" href="https://example.com/">
<link rel="alternate" hreflang="es" href="https://m.example.com/es/">  <!-- mobile hreflang 指 mobile -->
<link rel="alternate" hreflang="fr" href="https://m.example.com/fr/">

其他 separate URL 纪律

  • mobile 版不要用 URL fragment(Google 不索引 fragment)
  • desktop 和 mobile 各自 error page 状态码一致
  • 不同 desktop 页别全 redirect 到 mobile 首页(全部页会从索引消失)
  • 两版 Search Console 都验证
  • mobile 服务器capacity 充足

5.4 13 大 Troubleshooting Errors

Search Console 报这些 → mobile-first 索引中断 / 排名下滑:

Error 修法
Missing structured data(mobile 缺) 两版同步,验证 URL,定期看 Data Highlighter
noindex tag Mobile 用 noindex = 整站索引中断 — 移除
Missing image(mobile 缺图) 内容等价 + 别 lazy-load 主图 + 支持的图格式
Blocked image(robots.txt block) 允许 Googlebot 爬图
Low quality image(太小 / 低分辨率) 用高质图
Missing alt text mobile 加上和 desktop 一样的 alt
Missing page title mobile 加 <title> 等价 desktop
Missing meta description 同上
Mobile URL is an error page 两版 status code 一致
Mobile URL has anchor fragment 移除 fragment,用 History API
Mobile page blocked by robots.txt 检查 robots.txt 一致性
Duplicate mobile page target(多 desktop → 同 mobile) 各 desktop 对应独立 mobile
Desktop redirects to mobile homepage 各页对应等价 mobile 页
Page quality issues(广告太多 / 内容缺失) 遵守 Better Ads Standard
Video issues 易找到位置 + 别 lazy-load 主视频
Hostload issues(mobile 服务器不够) 扩容

Part 6 — Google 支持的 Meta Tag 完整表

6.1 基本结构

<meta> 放在 <head> 里。HTML 标准也支持 XHTML 形式。

6.2 ✅ Google 支持的 9 个

标签 用途
description 页面摘要(可能用作 snippet)
robots / googlebot 索引 + 呈现控制(见 抓取与索引控制完全指南 (robots.txt / noindex / X-Robots-Tag / data-nosnippet / rel) 11 条 valid rules)
notranslate 不在搜索结果提供翻译版
nopagereadaloud 禁 Google TTS 朗读
google-site-verification Search Console 所有权验证 — name + content 大小写必须严格匹配
Content-Type / charset 内容类型 + 字符集(推荐 UTF-8)
refresh meta 跳转 — 不推荐,用 server-side 301
viewport 移动渲染设置(存在 = 告诉 Google "mobile-friendly")
rating adult 内容标记(rating="adult" 或 RTA 字符串)

6.3 ❌ Google 不支持的 4 个(完全无效)

标签 状态
<meta name="keywords"> 完全无效 — Google 早不用了
<html lang="..."> 属性 Google 看正文内容判断语言,不看 lang 属性
<link rel="next"> / rel="prev"> 不再使用,完全忽略
nositelinkssearchbox 功能已下线,标签无效

6.4 ⚠️ JS 改 meta 的纪律

强烈推荐避免 JS 注入 / 修改 meta tag。必须用时 → 用 URL Inspection Tool 测试 rendered HTML。


Part 7 — Valid HTML <head> 元素白名单 ⭐

⚠️ 核心坑: <head> 里塞了非白名单元素 → Google 从这个元素开始切断,后面的 meta / link / title 全被忽略。

7.1 ✅ 白名单(8 个)

title / meta / link / script / style / base / noscript / template

7.2 ❌ 常见错误塞入(切断 head)

  • <iframe>
  • <img>

必须用? 把它放在所有想被 Google 读的 valid 元素之后。


Part 8 — Troubleshoot Crawling Errors

8.1 5 步法

1. 看 Googlebot 是否遇到 availability 问题(host 抗不住)
2. 看是否有该爬却没爬的页
3. 看更新是否被及时爬到
4. 改进 crawl efficiency
5. 处理 overcrawling 紧急情况

8.2 关键工具

  • Crawl Stats report(Search Console)— host availability 图,看 Googlebot 请求是否超红线
  • URL Inspection tool — 单 URL 测试,Hostload exceeded warning = 服务器扛不住
  • Page Indexing report — 找 soft 404 / 索引状态

8.3 服务器扛不住怎么办

  • robots.txt block 不重要资源(crawl budget)
  • 加快 page loading
  • 扩容 — 如果 Crawl Stats 持续超红线但还有重要 URL 没爬,加 1 个月看是否提升

8.4 重要页没被爬

  • 走 sitemap submit
  • 检查 robots.txt 没误 block
  • 优化 crawl budget,见 manage your inventory
  • 检查服务器 capacity

⚠️ 新页典型几天才被爬 — 不要期待当天索引,除非你是 news 站或高时间敏感站。

8.5 让 Google 更快发现更新

Do Avoid
News 站用 news sitemap 每天 submit 没变化的 sitemap
sitemap 用 <lastmod> 表示更新时间 期待 Googlebot 立刻爬 sitemap 里的全部
用 crawlable URL 结构 + <a href> link 把不想被索引的 URL 塞进 sitemap

8.6 If-Modified-Since / 304 优化 ⭐

Google 偶尔发 If-Modified-Since header(尤其 AdsBot):

  • Server 返 304 Not Modified 无 body → Google 复用上次抓的内容,节省 server 资源
  • 没变可以主动返 304(不需要 Google 先问),也省资源

8.7 soft 404 修复

Soft 404 = 页面返 200 但内容是 error / 空。Google 算法识别后从索引剔除。

状态 修法
页面真没了 返 404 或 410(404 + 友好提示 + 站内链接 + 报告按钮)
页面搬走了 返 301 redirect 到新位置
页面还在但被错判 URL Inspection 看渲染 — 多半是资源加载失败 / blocked resources

8.8 紧急处理 overcrawling

服务器被 Googlebot 压垮:

  1. 临时返 503 或 429(retry-after)— 撑 2 天
  2. 2 天内恢复 — 否则 URL 被永久踢出索引
  3. 监控 crawl rate + host capacity
  4. 如果是 AdsBot 在爬(每 3 周一次),减少 Dynamic Search Ad targets 或扩容

8.9 隐藏不想 Search 显示的 URL(crawl budget 优化)

  • robots.txt block(faceted nav / 日历 / 内部搜索 / shopping cart / "buy now")
  • 重复内容用 canonical 合并
  • session id 用 cookie 替代

⚠️ 不要频繁加/删 robots.txt 条目作为 budget 调配 — Google 会困惑。robots.txt 用于长期不想被爬。


Part 9 — Website Testing (A/B / Multivariate)

9.1 4 大铁律

Do 原因
不 cloak 给 Googlebot 一套、给用户一套 = 违反 spam policy,可能被踢出索引
用 rel=canonical 而非 noindex 标 test 变体 noindex 完全屏蔽,过头;canonical 表示"这是变体,本体是 X"
用 302 而非 301 redirect 302 = 临时,Google 保留原 URL 在索引;301 = 永久会替换
跑完测试立刻 cleanup 长期跑 → Google 视为欺骗,处罚

9.2 测试两种打法

  • 多 URL: 每变体一个 URL,通过 302 / JS 分流。所有变体 rel=canonical 指向原 URL。
  • 单 URL JS 动态: 同 URL 用 JS 决定显哪个变体。Googlebot 不带 cookie → 看到的是没 cookie 的版本。

9.3 不必担心的小测试

按钮颜色 / 字体 / "Add to cart" vs "Buy now!" → 即便被 Google 看到也不影响排名 / snippet。


Part 10 — AMP 概览

⭐ AMP 已经不是核心 SEO 重点(Top stories 不再要求 AMP,2024 后)。但你站还有 AMP 页就还要管。

10.1 AMP 在 Search 里怎么显示

形式 说明
Rich result 像普通页一样,可能在 carousel
Web Stories 给 Story 格式特殊处理
Google AMP Viewer(mobile) 顶部显域名标识 publisher;访问 google.com/amp/...
Signed Exchange(支持的浏览器) 用 publisher 自己 URL,可用 first-party cookie + analytics — 优先于 Viewer

⚠️ AMP 本身不是排名因子。速度才是。

10.2 两种配置

配置 含义
Canonical AMP 只有一版,AMP 本身就是 canonical
Canonical non-AMP 双版,有 non-AMP 主版 + AMP 子版

10.3 5 大 guideline

  1. 必须遵 AMP HTML spec
  2. AMP 内容 ≈ canonical 内容(用户能完成同样动作)
  3. URL 路径相关: amp.example.com/giraffes 或 example.com/amp/giraffes(不能是 test.com/giraffes)
  4. AMP 必须 valid(用 AMP Test Tool)
  5. structured data 遵 SD policy

10.4 移除 AMP 3 路径

路径 步骤
A. 整页移除(AMP + non-AMP) 1) 删两版 2) Remove outdated content tool 3) Update AMP Cache 4) 验证
B. 只移除 AMP(保留 non-AMP) 1) 移除 canonical 上的 rel="amphtml" link 2) AMP URL 返 301 或 302 到 canonical 3) 选: 想彻底移除 → 4) 返 404 + 5) update cache + 6) 301 永久 redirect
C. CMS 操作 WordPress / Drupal / SquareSpace 各有 plugin help

⚠️ 删 AMP 别直接清空内容 — 空 / 无 markup 的文档 = invalid → Google 会继续 serve 老版本!

10.5 AMP 已弃 vs 仍有用

仍有用 已弃用
速度优势(AMP 模板天然快) Top stories carousel 不再要求 AMP(2024 取消 AMP 要求)
Signed Exchange + AMP Cache 预渲染 AMP-only ranking boost(从未存在过)

Part 11 — 关键反 pattern 集锦

# 反 pattern 后果
1 <span href> / <a onclick> 当链接 Google 不解析,可能完全爬不到
2 URL 用 fragment(#/page) 不被索引
3 URL 用 underscore 分词 Google 不认作分词
4 URL 大小写不一致 被当不同页,内容重复
5 mobile 版精简内容 mobile-first 索引后排名暴跌
6 mobile 版有 noindex 整站从索引消失
7 <head> 里塞 <iframe> / <img> Google 切断 head 读取,后续 meta 全失效
8 用 <meta name="keywords"> 期待 SEO 提升 完全无效
9 测试用 301 redirect 而非 302 Google 把变体 URL 当 canonical,替换原 URL
10 测试用 noindex 标变体 主页被完全屏蔽
11 测试跑半年 被视为欺骗,处罚
12 服务器超载长期返 503 URL 永久被踢出索引
13 soft 404(200 内容是 error) 被识别后从索引剔除
14 用 robots.txt block 重要 JS/CSS 渲染失败,索引质量降
15 sitemap 频繁 submit 没变化的版本 crawl budget 浪费
16 删 AMP 时直接清空文件不删 invalid 文档 → Google 仍 serve 老版
17 mobile 页用 URL fragment 不被索引
18 内链堆链(<a> <a> <a> <a>) 读者难分辨,信号弱

Part 12 — 相关 wiki

Last updated

2026-05-17 — 基于 Google Search Central 14 篇 crawling-indexing 系列(2025-12 ~ 2026-02 最新)整理。Googlebot 文档 2026-02 含 AVIF 图片格式 + 64MB PDF 限额 / mobile-first 完整 troubleshooting / 14 个 valid robots rule 含 max-snippet AI Overviews 用法 / AMP 完整生命周期。

来源与关联资料