阻止搜索引擎扫描其他网页的预览

时间:2015-08-06 10:57:31

标签: html html5 search search-engine google-search

我有一个网站。在每篇文章之后,有另一篇文章的大(7句)预览。

问题是谷歌索引这个预览,它使我的内容重复。

如何告诉谷歌不要阅读这些预览?

3 个答案:

答案 0 :(得分:0)

您可以通过将预览部分放在Css属性隐藏的不同范围内并在页面加载时使用javascript显示来完成此操作。因为该部分最初未显示,因此搜索不会读取发动机。

虚拟Html代码

<span class="pgPreview">The preview for the next pages goes here </span>

隐藏它的Css代码

.pgPreview {
display:none;
}

显示它的Javascript代码。

<script type="text/javascript"> 
$(document).ready(function()
  {
      $(".pgPreview").show();
  }
</script>

假设您包含了jquery库。

Reference

答案 1 :(得分:0)

一个有效但不太理想的解决方案可能是使用Javascript加载随机文章预览。这类似于某些博客的“点击加载评论”按钮 - 他们不希望他们的博客在谷歌搜索中与他们的评论者所说的一切相关联。

由于您保持每个页面的主要内容相同,我认为这不会是cloaking问题,但不能保证。

答案 2 :(得分:0)

我知道曾经有一个标签系统,例如:

<!-- googleon/googleoff: <index|anchor|link|all> -->

......但我不知道这些日子是否还能运作...... 另外,我认为只有在使用google custom search时才有效 (确实不确定)

无论如何,我可以通过两种方式思考你需要做什么:

  • A)隐藏 iframes
  • 中的内容
  • B)使用该预览文本生成文本图像
  lolum dolimus
  situs amen amdu etr   --> normal content
  nulusan ar sindh ew
 _____________________
| lolum dolimus       |
| situs amen amdu etr | --> iframe blocked with
| nulusan ar sindh ew |     robots.txt file
 ---------------------
 _____________________
| lolum dolimus       |     image with text
| situs amen amdu etr | --> unreadable to
| nulusan ar sindh ew |     search engines
 ---------------------

当然,这两个选项并非完全绝对可靠,仅取决于搜索引擎是否遵循标准化指令和/或是否具有OCR识别能力。

相关问题