URL Inspection 怎么用——Search Console 最重要的工具

URL Inspection 告诉你 Google 看到什么、何时爬过、为什么收没收录。附 API 调用脚本,批量复用。

URL Inspection 是 Search Console 里最有用、也最容易被误读的一个面板。「Page is not indexed」不一定是坏事,绿色对勾也不一定是好事。每个字段实际是什么意思,下面讲清楚,并给出批量检查的 API 脚本。

问题背景

URL Inspection 对你已验证站点的任意 URL,会跑两份报告:已收录版本(Google 上次爬留下的快照)和 实时测试(Google 现在再爬一次会看到什么)。两者不一致的地方,往往就是你问题的答案。

判断标准

  • 想确认某一页是否被收录,但不想去 Google 搜 site:
  • 某页从搜索结果里消失了,不知道为什么。
  • 改了 canonical / robots / noindex,想确认 Google 看到了改动。
  • 刚发的文章,想手动申请一次收录。

快速结论

粘单个 URL → 读 Coverage → 跑实时测试 → 比对已收录 vs 实时 → 都正确才申请收录。

开始前准备

  • Search Console 已验证 property(Domain 或 URL-prefix)。
  • URL 准备好完整版(https:// + 与站点一致的尾斜杠)。
  • 批量用:URL Inspection API 的 OAuth token。

实操步骤

  1. 完整 URL 粘到 Search Console 顶部搜索框。 用站点真实提供的形态——尾斜杠很重要。

  2. 先读 Coverage。 含义:

"URL is on Google"                          → 已收录 ✓
"URL is on Google, but has issues"          → 已收录但有警告(仍可展示)
"URL is not on Google"                      → 未收录;原因看下一行
  ├─ "Discovered – currently not indexed"   → 排队;常隐含"薄/重复"
  ├─ "Crawled – currently not indexed"      → 已爬但被弃;通常是质量问题
  ├─ "Page with redirect"                   → 301/302 生效;索引在别处
  ├─ "Duplicate without user-selected canonical" → 修 canonical
  └─ "Excluded by 'noindex' tag"            → meta robots 在挡
  1. 点 View crawled page 看 Google 存的 HTML。看 canonical、渲染后 HTML、More info 里的 console 错误。

  2. 右上角 Test live URL,立刻抓一次。首先扫这几行:

Crawl allowed?              Yes / No        ← robots.txt
Page fetch                  Successful      ← 源站返回 200
Indexing allowed?           Yes / No        ← meta robots / X-Robots-Tag
User-declared canonical     <你的 URL>
Google-selected canonical   <你的 URL 或别的> ← 不一致就是 canonical 的 bug
  1. 批量检查用 API。 鉴权 curl:
curl -X POST "https://searchconsole.googleapis.com/v1/urlInspection/index:inspect" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  --data '{
    "inspectionUrl": "https://yourdomain.com/articles/foo/",
    "siteUrl": "sc-domain:yourdomain.com",
    "languageCode": "en-US"
  }' \
  | jq '.inspectionResult | {
        verdict: .indexStatusResult.verdict,
        coverageState: .indexStatusResult.coverageState,
        userCanonical: .indexStatusResult.userCanonical,
        googleCanonical: .indexStatusResult.googleCanonical,
        lastCrawl: .indexStatusResult.lastCrawlTime
      }'

返回样例:

{
  "verdict": "PASS",
  "coverageState": "Indexed, not submitted in sitemap",
  "userCanonical": "https://yourdomain.com/articles/foo/",
  "googleCanonical": "https://yourdomain.com/articles/foo/",
  "lastCrawl": "2026-05-20T14:02:00Z"
}
  1. 对一批 URL 循环 triage:
while read url; do
  curl -sX POST "https://searchconsole.googleapis.com/v1/urlInspection/index:inspect" \
    -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
    --data "$(jq -nc --arg u "$url" --arg s "sc-domain:yourdomain.com" \
              '{inspectionUrl:$u, siteUrl:$s, languageCode:"en-US"}')" \
    | jq -r --arg u "$url" '[$u, .inspectionResult.indexStatusResult.verdict, .inspectionResult.indexStatusResult.coverageState] | @csv'
  sleep 1   # 注意限流
done < urls.txt > inspection-report.csv
  1. 已收录和实时都正确才申请收录。 慎用——每个重要 URL 申请一次就够。

  2. 改过的页面:先实时测试确认 Google 看到改动,再申请收录。

执行检查清单

  • 检查的 URL 是主域形态(尾斜杠、语言前缀)。
  • Coverage 状态 + Google 选的 canonical 与预期一致。
  • 实时测试 Crawl allowed + Indexing allowed 都通过。
  • 超过 20 个 URL 走 API。
  • Request indexing 使用记账(日期 + 原因)。

上线后验证

  • 新 URL:申请收录 1-3 天后重跑 inspect,应从未收录 → 已收录(除非质量问题仍在)。
  • canonical 修复:Google-selected canonical 与 User-declared canonical 一致。
  • 解屏(robots / noindex):实时测试 Indexing allowed = Yes。

容易踩的坑

  • 看到「URL is on Google」就走了,没看下一行。页面可能被收录在另一个 canonical 下面。
  • 把「已收录版本」和「实时测试」搞混。已收录版本是一个快照,可能几周前的。
  • 同一个 URL 一天点好几次 Request indexing。Google 会忽略,还可能临时限流。
  • 带着 tracking 参数去 inspect。粘进去之前先把 ?utm_* 删掉,参数版对 Google 是另一个 URL。
  • 忽略实时测试里「Crawl allowed?」「Indexing allowed?」这两行——robots.txtnoindex 在挡你,这里马上能看到。
  • API 不做限流——软上限约 600/分钟,建议保持 60 以下。

FAQ

  • 为什么「URL is not on Google」有时候没写原因?: 通常意味着 Google 根本没爬过这个 URL。先确认它在 sitemap 里、站内有链接指过去,然后申请收录。
  • Request indexing 一天能点几次?: UI 每个 property 大致 10-20 次/天。API 有自己的配额,看响应头。
  • 申请收录后一定会被收录吗?: 不一定。它只是把 URL 推进 Google 的复查队列。如果页面薄、重复、或被屏蔽,照样不会被收录。
  • 为什么实时测试的 canonical 和已收录版本不一样?: 因为 Google 上次爬是在你改之前。确认实时测试的内容正确后申请收录,已收录版本几天内会跟上。
  • API 能 Request indexing 吗?: 不能。URL Inspection API 是只读。要主动推索引用 Indexing API(仅限职位、广播事件等少数场景)。

相关阅读

标签: #独立开发 #SEO #Google #Search Console #收录 #排查