【发布时间】:2013-03-19 02:09:13
【问题描述】:
我想告诉 Google 不要将页面的某些部分编入索引。在 Yandex(俄罗斯 SE)中有一个非常有用的标签,叫做<noindex>。谷歌如何做到这一点?
【问题讨论】:
标签: seo googlebot yandex noindex
我想告诉 Google 不要将页面的某些部分编入索引。在 Yandex(俄罗斯 SE)中有一个非常有用的标签,叫做<noindex>。谷歌如何做到这一点?
【问题讨论】:
标签: seo googlebot yandex noindex
不,Google does not support the <noindex> tag。几乎没有人这样做。
【讨论】:
您可以通过将这些部分放入被 robots.txt 阻止的 iframe 中来阻止 Google 看到页面的某些部分。
robots.txt
Disallow: /iframes/
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>
/iframes/hidden.html
Search engines cannot see this text.
您可以使用 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>
【讨论】:
在您的根级别创建一个 robots.txt 文件并插入如下内容:
屏蔽谷歌:
User-agent: Googlebot
Disallow: /myDisallowedDir1/
Disallow: /myDisallowedPage.html
Disallow: /myDisallowedDir2/
阻止所有机器人:
User-agent: *
Disallow: /myDisallowedDir1/
Disallow: /myDisallowedPage.html
Disallow: /myDisallowedDir2/
一个方便的 robots.txt 生成器:
【讨论】:
根据维基百科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-->
不幸的是,他们似乎无法就单一标准达成一致——据我所知,没有什么可以阻止所有蜘蛛...
googleoff: 评论似乎支持不同的选项,但我不确定哪里有完整的列表。至少有:
还要注意(至少对 Google 而言)这只会影响 搜索索引,而不是页面排名等。此外,正如 Stephen Ostermiller 在下面的评论中正确指出的那样,@987654341 @ 和 googleoff only work with the Google search appliance and have no effect on normal Googlebot,很遗憾。
还有一篇关于 Yahoo 部分的文章2(还有一篇文章描述了 Yandex 也向 <noindex>6 致敬)。在googleoff:部分,也可以看this answer,这篇文章大部分相关信息我都取自。3
此外,Google Webmaster Tools 建议对特定链接使用rel=nofollow 属性4(例如广告或机器人无法访问/无用的页面链接,例如登录/注册)。这意味着,HTML a rel Attribute 应该受到 Google 机器人的尊重——尽管这主要与页面排名有关,而不是与搜索索引本身有关。不幸的是,似乎没有rel=noindex5,7。我也不确定这个属性是否也可以用于其他元素(例如<DIV REL="noindex">);但除非爬虫尊重“noindex”,否则这也没有意义。
更多参考资料:
REL="noindex" 设为标准,而不是与任何 HTML 标记(例如 DIV/SPAN/)一起使用P/A!)1Wikipedia: Noindex
2Which Sections of Your Web Pages Might Search Engines Ignore?
3Tell Google to Not Index Certain Parts of Your Page
4Use rel="nofollow" for specific links
5Is it a good idea to use <a href=“http://name.com” rel=“noindex, nofollow”>name</a>?
6Using HTML tags — Yandex.Help. Webmaster
7existing REL values p>
【讨论】:
googleoff 和 googleon only work with the Google search appliance and have no effect on normal Googlebot