6

Let's say I have a publicly accessible page that contains an iframe back to a different page on my own domain. By default, google (and other crawlers) will index that page and the iframe's content. It may also associate that iframe content with the parent page, but that's not relevant to this question.

What I want to do is prevent links on the parent page from being crawled, but I still want to allow bots to crawl the iframe. If I add <meta name="robots" content="nofollow"/> to my parent page, does that also tell bots not to crawl the iframe?

0

3 Answers 3

0

If a page has content="nofollow" , google will not index the page and links inside that page also . so your iframe page also will not be indexed . Unless the iframe link is there from some other page also which doesnt have a no follow tag . or create a sitemap with the pages in that iframe and submit to google for indexing.

1
  • Assuming this answer is correct, it directly answers my question. Do you have any references to back up your answer? I couldn't find any myself
    – akhaku
    Apr 16, 2014 at 21:49
0

If i understand your question correctly then you want to really apply a no follow on the links that are inside the iframe?

Personally i would have said this to be more a job on SO then webmasters however, i'm not sure on an exact way of doing this but these may provide a temporary fix but you may want to investigate them before trying.

  • My first approach (but not sure this is exactly what you are looking for)

you can add rel="nofollow" onto an iframe like so <iframe rel="nofollow" src="http://mysite.com">

  • My Second approach (i think this would again not be your ideal)

you can use javascript to add in the iframe as javascript will not be indexed. Using this method however will not only apply a "nofollow" rule but it will not get indexed as it is added in using javascript

Another alternative is from this post

This was the top result page#1 on Gxxgle and it had not been answered as of yet. How sad. Absolutely, you kind of can add rel="nofollow" to an iframe. You just must be tricky about it. Here's how... Build a blank html file. Add your iframe to that alone. In the Meta tag include

<meta name="robots" content="noindex,nofollow">

Now, iframe that page onto the one your going to show. Easy as pie.

1
  • Sorry, it's actually the other way around. I want to "nofollow" the links outside the iframe (in the parent window), but I want to allow Google/other bots to index the iframe contents themselves. I suspect that if I add a nofollow to the parent page, that will restrict crawlers from crawling the iframe contents, but I'm not sure about that and that is in fact my question.
    – akhaku
    Apr 3, 2014 at 22:49
0

Nofollow does not prevent crawling

What you probably need to do is one of the following:-

  1. Have all the links on the page be redirects that are blocked using robots.txt
  2. Encode all links on the page using javascript, and have the decoding function in an included script that is blocked using robots.txt to be 100% sure Google doesn't crawl the links

That still doesn't prevent the destination pages being indexed from other links

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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