グーグルのインデックスから完全なページを除外する方法があります。しかし、ウェブページの特定の部分をグーグルのクロールから明確に除外する方法はありますか?たとえば、通常は無関係なコンテンツが含まれているサイドバーを除外しますか?
2 に答える
IFRAME タグを使用して、Googlebot で非表示にするページの部分を含め、robots.txt ファイルから含まれるファイルのインデックス登録をブロックできます。
ページにサイドバーを含めるためのiframeを追加します
<iframe src ="sidebar.asp" width="100%" height="300">
</iframe>
ここでは、スパイダーをブロックするために robots.txt ファイルに追加するルールを示します。
user-agent: *
disallow: sidebar.asp
If you're doing this for AdSense, here's an article on how to exclude content from the scraper. If you don't want Google to follow links, you can give them a rel="nofollow"
attribute. Otherwise, I'm afraid you may be out of luck here.
Something else you could do, but I wouldn't necessarily recommend doing, is detecting the user agent before rendering your page, and if it's a spider or bot, not showing the portions of your page you want to exclude.