更新 Googlebot 的 user agent

2019年10月2日,星期三

正如我们今年早些时候在 Google I/O 上所宣布的那样,Googlebot 使用基于 Chrome 的浏览器来渲染网页。作为该计划的一部分,我们将在 2019 年 12 月更新 Googlebot 的用户代理字符串(user agent strings)以反映新的浏览器版本,并定期更新版本号,使其与 Googlebot 中的 Chrome 更新保持一致。

更新 Googlebot 的 user agent

请参阅Google 爬虫(用户代理)
以及
确保 Google 可以索引 JavaScript
以了解有关用户代理字符串和渲染的背景知识。

当前的 Googlebot 用户代理

移动端:

Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +https://www.google.com/bot.html)

桌面端:

Mozilla/5.0 (compatible; Googlebot/2.1; +https://www.google.com/bot.html)

更新 Googlebot 的 user agent — 2

或

Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +https://www.google.com/bot.html) Safari/537.36

全新的常青版 Googlebot 及其用户代理

从 12 月开始,我们将定期更新上述用户代理字符串,以反映 Googlebot 所使用的 Chrome 版本。在以下用户代理字符串中,W.X.Y.Z 将被替换为我们正在使用的Chrome 版本。例如,你看到的将不再是 W.X.Y.Z,而是类似于 76.0.3809.100 的版本号。此版本号将定期更新。

移动端:

Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/W.X.Y.Z Mobile Safari/537.36 (compatible; Googlebot/2.1; +https://www.google.com/bot.html)

桌面端:

Mozilla/5.0 (compatible; Googlebot/2.1; +https://www.google.com/bot.html)

或

Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +https://www.google.com/bot.html) Chrome/W.X.Y.Z Safari/537.36

如何测试你的网站

我们已经进行了评估,确信大多数网站不会受到此次变更的影响。

遵循我们建议、使用特性检测(feature detection)和渐进增强(progressive enhancement)而非用户代理嗅探(user agent sniffing)的网站,无需任何更改即可继续正常运行。

如果你的网站针对特定用户代理进行检测,则可能会受到影响。你应该使用特性检测来代替用户代理嗅探。如果你无法使用特性检测,且必须通过用户代理来识别 Googlebot,请在用户代理字符串中查找“Googlebot”。

我们在评估此次变更时发现的一些常见问题包括:

  • 页面显示错误消息而非正常内容。例如,页面可能误将 Googlebot 识别为启用了广告拦截器的用户,从而意外阻止其访问页面内容。
  • 页面重定向到被 robots.txt 禁止或包含 noindex 标签的文档。

如果你不确定自己的网站是否受到影响,可以尝试在浏览器中使用新的 Googlebot 用户代理加载网页。这些说明展示了如何在 Chrome 中覆盖你的用户代理。

如有任何疑问,请务必联系我们的站长帮助社区,参加我们在 YouTube 上的站长办公时间,或在 Twitter 上关注我们。

Alien Road

How we apply this

Google announcements age. We keep this post here for the record, and we note for clients whether the behaviour it describes still applies today or has since been superseded.

Related services

Share