Philipp Küng
Philipp Küng

Reputation: 37

Block certain html element from getting indexed by search engines

For styling purposes i want to insert some dummy text on the page, but it shouldn't be getting linked to the actual content. Is there a way to block it for search engines, or do i have to use good old images for that?

Or would it be possible to load it dynamically via javascript? because i heard that google will read certain amount of javascript.

Upvotes: 2

Views: 795

Answers (4)

SpliFF
SpliFF

Reputation: 38966

I'd be extremely careful with whatever trick you decide on. Odds are just as likely google will think you're trying to display different content to the user than to it.

I've always believed that Google actually works by rendering the page (possibly using some server-side version of the Chrome rendering engine) and then reads the result back with OCR software to confirm that the text in the source matches what the user would see with JS and frames enabled. Google has always openly warned webmasters not to try serving robots different content to the users, OCR would be the perfect way to find out (especially if your 'verifier' used IE's user-agent string and crawled from IP ranges not registered by Google).

Short answer then, serve the decoration as either:

  • an iframe
  • an object
  • an SVG image

Since your clearly linking the document into your page google will proably consider it a seperate resource and rate things accordingly, especially if the same text appears on every page. Which brings me to:

Are you going to use the same text decor on all/most pages? If so Google will almost certainly treat it as "window dressing" and ignore it (it apparently does this with menus and such).

Upvotes: 0

Piskvor left the building
Piskvor left the building

Reputation: 92752

If you load that text via AJAX it probably won't be indexed - last time I checked, GoogleBot doesn't actually execute JS (nor do the other spiders (but some spambots apparently can and do)).

Caveat: the AJAX response should probably contain a X-Robots-Tag: noindex header, in case its URL is actually linked somewhere.

Upvotes: 1

lance
lance

Reputation: 16342

Can you show the content in a borderless iframe, and block the iframe's src (a completely separate "page") from the search engines?

Alternatively, add the content with javascript, storing the javascript in a .js file that you block from the engines?

Upvotes: 1

brettkelly
brettkelly

Reputation: 28205

I'd guess that loading in the content after the page has finished loading (when the document.ready event fires, for example) would be a fairly safe way to do what you're talking about. Not 100% sure about this, though.

Upvotes: 0

Related Questions