How to exclude certain portions of my website from bots/web crawlers?

Viewed 11

I have made custom segments/blocks around my website which I use it for advertising/marketing. Google search bots are considering those as part of my website and gets confused of what my site really is versus advertisement.

This negatively impacts my SEO. Is there a way I can register or use certain directives or elements to inform google and other bots to avoid crawling that portion or even if crawled should not be considered as part of that page.

I am aware of robots.txt file but that is for an entire page. I would like to block a certain blocks within each page. This could be a side bar a floating bar.

1 Answers

there's no way to ensure all bots don't index parts of a page. it's kind of a all or nothing thing.

can could use a robots.txt file and with

Disallow: /iframes/

then load the content you don't want indexed into iframes.

there's also the data-nosnippet-attr tag attribute.

Related