Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have many pages with lots of text in it. But I will always have two sections of text and I want to prevent one section from appearing in search results, the other section must be indexed.

<p class="please-index-me">text</p>

<p class="get-out">never index me please</p>

I thought that maybe if I load the "please don't index me text" with JavaScript maybe search engines wouldn't look for it. But I am not sure it would work and this is not really nice.

I was wondering if there is a way to tell search engines "hey, this text you can't grab, move on". So, is there a way to do it?

share|improve this question
Yeah. I don't don't of any feature to do that sort of a thing although Google understands all sorts of markers, but I've seen one that says "do not index". The IFRAME solution proposed is pretty the only one I could think of. – Alexis Wilke Nov 9 '13 at 5:20

One way I found here, is using an <iframe> and blocking the URL in robots.txt.

block text section

share|improve this answer

It may depend on what type of search results, and I think it also depends on the search engine.

From what I can tell, the techniques outlined here only work for the 'Google Custom Search' tool (results within the site, not results on Google).

Also, I can't recall exactly how but I think Yahoo has a method that let's you apply a class to an element (i.e. something like <p class="yahoo-no-index">) to have it excluded from crawling.

I doubt that's exactly what you are looking for but perhaps it'll be helpful.

share|improve this answer

One thing that may be possible is to keep the section you do not want indexing in a collapsed <div>. You can then use some button to trigger a JavaScript/jQuery event and inject the content into the <div>.

$(".get-out").html("Enter the content you do not want indexing here.");

As long as the visibilty is invoked by a user action (i.e. clicking a button) this will not be considered as cloaking.

You may also be able to use a modal box like Facebox. I'm really not sure if this will fit in with your format but it will solve the indexing problem.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.