Optimising Iframes for SEO: What Our Experiment Still Teaches Us

Iframes are one of the oldest ways of pulling content from one web page into another, and they remain everywhere: embedded maps, video players, booking widgets, reviews, calculators and third-party tools. The question we set out to answer years ago still matters today — when you iframe content into a page, does Google credit that content to your page, or to the source document it actually lives on? Back in 2017 we ran a controlled experiment to find out. The mechanics of the modern web have moved on, but the core finding has held up remarkably well, and it has direct consequences for how you should and shouldn’t use iframes for SEO.

What an iframe actually does to a page

An iframe embeds one document inside another. The visitor sees a single, seamless page, but technically there are two separate URLs in play: the master page that contains the iframe tag, and the iframed page whose content is being displayed. You can even nest an iframe inside an iframed page, multiplying the URLs further.

That separation is the root of the SEO problem. Google generally treats the iframed content as belonging to its own source document, not to the page that hosts it. As Google’s John Mueller put it at the time, “if a page is embedded within an iframe, within a bigger other page, then it’s possible that we will index that embedding page as well.” In other words, Google tries to associate framed content with the host page, but it cannot guarantee it — and it may index the embedded URL in its own right, creating duplication or attributing your content to the wrong place.

The experiment: can you control how an iframe is crawled?

Rather than rely on guidance alone, we applied the same evidence-led approach that underpins our data science and analytics work and tested four techniques in a controlled lab environment. Throughout, the “master page” is the page containing the iframe tag, and the “iframed page” is the content loaded inside it.

Test 1 — Cross-domain canonical tags

We placed a canonical tag on the master page pointing to the iframed content’s true URL — Mueller’s own recommendation. On day one, both the master and iframed pages were indexed, with Google pulling the master page’s title and description from the iframed content. By day two the canonical had been honoured: the master page was dropped and only the source page remained indexed. The verdict: it works, but only if you control the domain hosting the iframed content so you can add the canonical — which rules out most third-party embeds.

Test 2 — Blocking with robots.txt

We isolated the embed in a subdirectory and disallowed it in robots.txt. Google Search Console flagged the blocked resource at “High” severity, warning that “if Googlebot can’t access important resources on your page, the page might be indexed incorrectly.” Blocking the resource hurt the master page’s ability to be indexed correctly. Not recommended.

Test 3 — Meta robots noindex, nofollow

We added noindex, nofollow meta tags to the iframed page. Google followed the iframe’s links regardless and the page still failed to render cleanly. The directive behaved much like a nofollow attribute and gave us no reliable control. Ineffective.

Test 4 — On-demand (lazy-loaded) iframes

Finally, we swapped the raw iframe tag for a placeholder built from a div, a static image, CSS and a small script, so the iframe only loaded when a user clicked or tapped it. The master page rendered cleanly for crawlers, the troublesome embedded resource was no longer pulled in at load, and page load speed improved across the board. This was the only approach that worked universally, regardless of whether we owned the embedded content.

What’s changed since 2017 — and what hasn’t

The browser landscape has moved on, but the central conclusion is still sound. Google continues to attribute iframed content to its source document rather than to the page that embeds it, so an iframe is a poor container for any content you actually want to rank on a given URL. Two practical things have evolved:

  • Native lazy-loading. You no longer need a third-party script generator to defer an iframe. Modern browsers support loading="lazy" directly on the iframe element, which delivers the same performance and crawl benefits as our 2017 on-demand technique with far less code.
  • Rendering is more capable, but not a fix. Google now renders JavaScript far more reliably than it did in 2017, so embeds are processed more consistently. That improves how cleanly a page renders — it does not change who gets credit for the embedded content.

Practical guidance: when iframes are fine, and when to avoid them

  • Never iframe your primary, rankable content. Body copy, headings and the keyword-bearing text a page needs to rank on should live in the page’s own HTML, not inside a frame. If it’s important enough to rank, it belongs in the source document.
  • Iframes are fine for supplementary functionality. Maps, embedded videos, booking calendars, third-party widgets and interactive tools are sensible iframe candidates — they support the user experience without carrying the page’s ranking weight.
  • Lazy-load every iframe you can. Add loading="lazy" to defer offscreen embeds. It protects Core Web Vitals (notably LCP), keeps heavy third-party resources off the critical path, and avoids the crawl-rendering issues we saw when embeds loaded eagerly.
  • Use a canonical when you control both ends. If you genuinely need to iframe your own content across domains, point a canonical at the true source so Google consolidates indexing on the right URL.
  • Always provide context around an embed. Surround a widget or map with descriptive on-page text and a clear heading, so the host page still earns relevance from content the crawler can read directly.

The headline takeaway is simple and has aged well: treat iframes as a tool for embedding features, not for hosting the content you want to rank. Reserve your own HTML for the words that matter, lazy-load the embeds that support them, and you sidestep almost every iframe SEO pitfall.

Take the guesswork out of technical SEO

This experiment first ran under the Search Laboratory name, whose technical-SEO and data heritage now lives on at Havas Market. The same testing-led mindset shapes how we approach crawl, indexation and site performance today. If iframes, embeds or indexation issues are holding a site back, we can audit, diagnose and fix them with evidence rather than assumption.