阻止搜索引擎索引页面上不相关内容的方法 [英] Methods for preventing search engines from indexing irrelevant content on a page
问题描述
我正在寻找方法来防止页面的部分索引。具体而言,在页面上发表评论,因为他们根据用户写的内容对条目进行了很多权衡。这使得在网页上的谷歌搜索返回了许多不相关的页面。
以下是我目前正在考虑的选项:
1)使用JavaScript加载评论以防止搜索引擎看到它们。
2)使用用户代理嗅探器不会为抓取工具输出注释。
$ b
3)使用特定于搜索引擎的标记来隐藏页面的某些部分。不过,这个解决方案看起来古怪。据称,这可以做到防止雅虎!索引特定内容:
< div class =robots-nocontent>
此内容不会被编入索引!
< / div>
这是非常丑陋的做法。我阅读了一个看起来更好的Google解决方案,但我相信它只适用于Google Search Appliance(有人可以证实这一点吗?):
<! - googleoff:all - >
此内容不会被编入索引!
<! - googleon:all - >
有没有人推荐其他方法?以上三项中的哪一项是最好的选择?就我个人而言,我倾向于#2,因为它可能不适用于所有的搜索引擎,所以很容易针对最大的搜索引擎。而且它对用户没有任何副作用,除非他们故意尝试模仿网络爬虫。
我会去与您的JavaScript选项。它有两个好处:$ b $ 1 bots没有看到
2)它会加快你的页面加载时间(异步和不显眼地加载注释,例如通过jQuery)...页面加载时间对搜索排名有很大的低估正面影响
I'm looking for ways to prevent indexing of parts of a page. Specifically, comments on a page, since they weigh up entries a lot based on what users have written. This makes a Google search on the page return lots of irrelevant pages.
Here are the options I'm considering so far:
1) Load comments using JavaScript to prevent search engines from seeing them.
2) Use user agent sniffing to simply not output comments for crawlers.
3) Use search engine-specific markup to hide parts of the page. This solution seems quirky at best, though. Allegedly, this can be done to prevent Yahoo! indexing specific content:
<div class="robots-nocontent">
This content will not be indexed!
</div>
Which is a very ugly way to do it. I read about a Google solution that looks better, but I believe it only works with Google Search Appliance (can someone confirm this?):
<!--googleoff: all-->
This content will not be indexed!
<!--googleon: all-->
Does anyone have other methods to recommend? Which of the three above would be the best way to go? Personally, I'm leaning towards #2 since while it might not work for all search engines, it's easy to target the biggest ones. And it has no side-effect on users, unless they're deliberately trying to impersonate a web crawler.
I would go with your JavaScript option. It has two advantages:
1) bots don't see it 2) it would speed up your page load time (load the comments asynchronously and unobtrusively, e.g. via jQuery) ... page load times have a much underrated positive effect on your search rankings
这篇关于阻止搜索引擎索引页面上不相关内容的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!