I have a widget distributed in some sites via an iframe. But I don't want the google bot index the url. Will adding a nofollow
to iframe
tag resolve the problem?. Does Iframe
tag support nofollow
, and will Google understand it?

- 178,213
- 47
- 333
- 501

- 3,129
- 3
- 32
- 49
6 Answers
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.
According to Google, all you need is
<meta name="robots" content="none" />
“none - Equivalent to noindex, nofollow”

- 12,523
- 8
- 46
- 41
It is not possible but there is a workaround for it. You can use a URL of your domain that redirects to the IFRAME. In your robots.txt, you will prevent the bots to follow the link of your URL.
In your robots.txt add
User-agent:*
Disallow:/h/
Then, create a 301 redirect in your htaccess or something similar if you use something else like nginx. that will redirect a local URL to the URL of the Iframe.
Redirect 301 /h/fancy-url/ http://targetdomain.com/the-uri-of-iframe/
In your iframe use the
<iframe src="https://yourdomain.com/h/fancy-url/?possibleparam=xx">

- 2,086
- 1
- 29
- 38
"rel" is not a recognised attribute for the "iframe" tag according to W3C specs. You could use some javascript and document.write to place the iframe code on the page

- 224
- 1
- 11
you might want to check out is IFrame crawled by Google? but from my understanding the "nofollow" is not allowed on an iframe

- 1
- 1

- 25
- 7