如何从谷歌的索引中排除网页的一部分? [英] How to exclude part of a web page from google's indexing?

查看:26
本文介绍了如何从谷歌的索引中排除网页的一部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一种方法可以从 google 的索引中排除完整的页面.但是有没有办法专门从谷歌的抓取中排除网页的某些部分?例如,排除通常包含无关内容的侧边栏?

There's a way of excluding complete page(s) from google's indexing. But is there a way to specifically exclude certain part(s) of a web page from google's crawling? For example, exclude the side-bar which usually contains unrelated contents?

推荐答案

您可以使用 IFRAME 标记包含要在 Googlebot 中隐藏的页面部分,并阻止对包含在 robots.txt 文件中的文件进行索引.

You can include with an IFRAME tag the part of the page that you want hide at Googlebot and block the indexing of the file included from the robots.txt file.

添加 iframe 以在页面中包含侧边栏

add the iframe for include the side-bar in your page

<iframe src ="sidebar.asp" width="100%" height="300">
    </iframe>

这里要在robots.txt文件中添加阻止蜘蛛的规则

here the rules to be added in the robots.txt file for block the spider

user-agent: *
disallow: sidebar.asp

这篇关于如何从谷歌的索引中排除网页的一部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆