谷歌的<noindex>标签

tes*_*mus 19 seo googlebot noindex yandex

我想告诉谷歌不要索引页面的某些部分,在yandex(俄语se)中有一个非常有用的标签叫做<noindex>.怎么用谷歌呢?

Izz*_*zzy 20

根据维基百科1,一些蜘蛛遵循一些规则:

<!--googleoff: all-->
This should not be indexed by Google. Though its main spider, Googlebot,
might ignore that hint.
<!--googleon: all-->

<div class="robots-nocontent">Yahoo bots won't index this.</div>

<noindex>Yandex bots ignore this text.</noindex>
<!--noindex-->They will ignore this, too.<!--/noindex-->
Run Code Online (Sandbox Code Playgroud)

不幸的是,他们似乎无法就单一标准达成一致 - 据我所知,没有什么可以阻止所有蜘蛛脱落......

googleoff:评论似乎支持不同的选择,但我不知道那里是一个完整的清单.至少有:

  • all:完全忽略该块
  • index:内容不会进入Google的索引
  • anchor:链接的锚文本不会与目标页面关联
  • 片段:文本不会用于为搜索结果创建代码段

请注意(至少对谷歌而言)这只会影响搜索索引,而不会影响页面排名等.此外,正如Stephen Ostermiller在下面的评论中正确指出的那样,googleon并且googleoff 仅与Google Search Appliance配合使用并且对不幸的是,正常的Googlebot.

还有一篇关于雅虎第2部分的文章(以及描述Yandex也荣誉<noindex>6的文章).在这方面googleoff:,也看到了这个答案,以及我从中获取了大部分相关信息的文章.3


此外,Google网站管理员工具建议将rel=nofollow属性4用于特定链接(例如广告或指向无法访问/对机器人有用的页面的链接,例如登录/注册).这意味着,HTML机器人应该尊重HTML属性 - 虽然这主要与网页排名有关,而与搜索索引本身无关.不幸的是,似乎没有rel=noindex5,7.我也不确定这个属性是否也可以用于其他元素(例如<DIV REL="noindex">); 但除非爬虫尊重"noindex",否则这也没有意义.


进一步参考:


1 维基百科:Noindex
2 您的网页哪些部分可能会被搜索引擎忽略?
3 告诉Google不要将您网页的某些部分编入索引
4 使用rel ="nofollow"获取特定链接
5 使用它是个好主意<a href=“http://name.com” rel=“noindex, nofollow”>name</a>吗?
6 使用HTML标签 - Yandex.Help.网站管理员
7 现有的REL值

  • `googleoff`和`googleon` [仅适用于Google Search Appliance,对普通Googlebot不起作用](http://webmasters.stackexchange.com/questions/54735/can-you-use-googleon-and-googleoff-评论对防止-的Googlebot从索引-p) (5认同)

Ste*_*ler 7

您可以通过将这些部分放在被robots.txt阻止的iframe中来阻止Google查看部分网页.

的robots.txt

Disallow: /iframes/
Run Code Online (Sandbox Code Playgroud)

的index.html

This text is crawlable, but now you'll see 
text that search engines can't see:
<iframe src="/iframes/hidden.html" width="100%" height=300 scrolling=no>
Run Code Online (Sandbox Code Playgroud)

/iframes/hidden.html

Search engines cannot see this text.
Run Code Online (Sandbox Code Playgroud)

您可以使用AJAX加载隐藏文件的内容,而不是使用iframe.以下是使用jquery ajax执行此操作的示例:

his text is crawlable, but now you'll see 
text that search engines can't see:
<div id="hidden"></div>
<script>
    $.get(
        "/iframes/hidden.html",
        function(data){$('#hidden').html(data)},
    );
</script>
Run Code Online (Sandbox Code Playgroud)