我有几个 wordpress 网站,使用当前的 google seo 算法更新网站应该适合移动设备 (here)
我的查询如下,目前我在robots.txt中写了一条规则,禁止使用wp-抓取url
User-agent: *
Disallow: /cgi-bin
Disallow: /wp-admin
Disallow: /wp-includes
Disallow: /wp-content/plugins
Disallow: /feed
Disallow: /*/feed
Disallow: /wp-login.php
我不希望谷歌抓取上述网址。早些时候它工作正常但现在随着最近的谷歌算法更新,当我不允许这些 url 时它将开始在移动友好测试中给出错误(here)。因为我所有的 CSS 和 JS 都在 wp-url 的后面。我想知道如何解决这个问题。 任何建议表示赞赏。
最佳答案
如果您让抓取工具远离这些文件,您的网页在 Google 上的外观和工作方式可能与在访问者看来不同。这是谷歌想要避免的。 允许 Google 访问 CSS 或 JS 文件没有问题,因为任何其他可以打开您的 HTML 源代码和阅读链接的人都可以访问它们。
因此 Google 肯定想访问您页面上使用的 CSS 和 JS 文件: https://developers.google.com/webmasters/mobile-sites/mobile-seo/common-mistakes/blocked-resources?hl=en
需要这些文件来呈现您的页面。
If your site’s robots.txt file disallows crawling of these assets, it directly harms how well our algorithms render and index your content. This can result in suboptimal rankings.
如果您依赖移动排名,则必须遵循 Google 的指导方针。如果没有,请随时阻止爬虫。
关于wordpress - 将 robots.txt 保持为空白,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30920509/