iFrame SEO

A long time ago I made some tests to see how Google treated content included into a page via an iframe. My conclusion was that it was considered part of the pages content, and that a page could rank for content within iframes

Since then, some big changes have happened. Google now renders pages and uses the rendered version for indexing. In the past, including iframe content would have been a special case for the crawler/indexer. Now, the rendered page automatically includes the content of any iframes.

A recent case related to rich snippets from structured data in an iframe reminded me about it, and had me wondering how they are treated now. So I did some new tests.

noindex an iframe

noindex and indexifembedded an iframe

iframe head section and meta tags

Structured Data & Rich Snippets

Disallow in Robots.txt

What happens if you included an iframe that is disallowed via robots.txt?

The content of the iframe is not included in the rendered results. Most likely the content will not be searchable for. The included file should not be crawled but the preview tools can still show the content.

X-Frame-Options = DENY

What happens if you included an iframe that has X-Frame-Options set to DENY?

The content of the iframe is not included in the rendered results. The content is not indexed nor should be available in any previews.

Conclusion

  • iframe based noindexing can be used to exclude parts of a page from search result.
  • Structured Data can be placed in iframes and be considered as part of the main page.
  • Do not use meta tags in iframe content for Structured Data.

That concludes my Sunday experiment for this week.