Guides โ€บ On-Page

How to Fix Key Content Hidden Inside Iframes

Content inside an iframe is a separate document loaded from another URL, so crawlers often do not credit it to your page. This guide shows you how to find pages where important text sits in iframes, move that text into the page's own HTML, and handle the iframes you keep.

โฑ 30-90 minutes depending on number of pages๐ŸŽฏ Intermediateโ— Low impactOn-Page
ON-PAGE ยท FIX GUIDE Key content inside iframes IMPACTEFFORT TIME30-90 minutes depending on number of pages LEVELIntermediate

Why it matters

Google says it tries to associate framed content with the parent page but does not guarantee it, so iframed text may rank for the iframe's URL instead of yours, or not at all. Most AI crawlers, including GPTBot, ClaudeBot and PerplexityBot, fetch raw HTML and do not follow iframes, so pricing, FAQs or product details inside an iframe are usually left out of AI answers. Screen-reader users and people on slow connections also get a worse experience when core content depends on a nested document. The impact is low for embeds like videos and maps. It matters most when the iframe holds the text the page is meant to rank for.

โœ•Beforehttps://example.com/pricing shows anempty <main> with <iframesrc="https://widgets.example-vendor.com/pricing-table?id=42">โœ“Afterhttps://example.com/pricing has theplan names, prices and features as<h2>, <table> and <p> elements in the

What you need

Edit access to the CMS or page templates
A list of flagged URLs from your audit or a crawler such as Screaming Frog
Browser DevTools (Chrome or Firefox)
Access to the third-party widget's settings or API if the iframe comes from a vendor

Step-by-step fix

1

List every iframe on the flagged pages

Open each flagged URL, open DevTools (F12) and run the snippet below in the Console. It prints each iframe's source, size and title. To check many pages at once, use the command-line version on the raw HTML, or in Screaming Frog go to Configuration > Custom > Custom Search and search for <iframe.

javascript
[...document.querySelectorAll('iframe')].map(f => ({src: f.src, w: f.offsetWidth, h: f.offsetHeight, title: f.title}))

# Command line, raw HTML only:
curl -s https://example.com/pricing | grep -oi '<iframe[^>]*>'
Pro tip: A large iframe (for example taller than 400px) inside <main> almost always holds key content. Small 1x1 iframes are usually tracking tags and can be ignored.
2

Separate key content from acceptable embeds

Decide which iframes hold text the page should rank for and which are true embeds. Common key content in iframes:

  • pricing tables
  • FAQs
  • product specs
  • restaurant menus
  • job listings
  • reviews
  • documentation
  • embedded Google Docs or PDFs

Iframes you can usually keep:

  • YouTube or Vimeo players
  • Google Maps
  • payment and checkout forms
  • booking calendars
  • ads
  • consent banners
Pro tip: Test each iframe by asking: if this iframe vanished, would the page still answer the query it targets? If not, the content needs to move.
3

Move first-party content into the page HTML

If the iframe loads a page from your own site (for example /embed/faq.html), copy its content into the parent page template. Use real semantic elements: headings, paragraphs, lists and tables. If several pages share the content, use your CMS's reusable blocks or a server-side include rather than an iframe, so the text appears in the HTML response.

html
<!-- Before -->
<iframe src="/embed/faq.html" width="100%" height="900"></iframe>

<!-- After -->
<section id="faq">
  <h2>Frequently asked questions</h2>
  <h3>How long does shipping take?</h3>
  <p>Example Co ships within 2 business days. Delivery takes 3-5 days in the US.</p>
  <h3>Can I return an item?</h3>
  <p>Yes, within 30 days of delivery.</p>
</section>
Pro tip: Use native <details>/<summary> if you want collapsible FAQs. The text stays in the HTML and is crawlable.
4

Switch vendor widgets to an inline or API mode

For third-party iframes such as reviews, job boards and menus, check the vendor's settings for an inline, JavaScript (non-iframe), SEO or API embed option. The best option renders the content on your server from the vendor's API, so it is in the raw HTML. A JS widget that writes into your DOM is the second-best option: Google renders it, but most AI crawlers will not. If the vendor offers only iframes, publish a static HTML summary of the key facts on the page as well.

php
<?php
// Server-side render from a vendor API (example)
$jobs = json_decode(file_get_contents('https://api.example-jobs.com/v1/boards/example-co/jobs'), true);
foreach ($jobs['jobs'] as $job) {
  echo '<article><h3>' . htmlspecialchars($job['title']) . '</h3>';
  echo '<p>' . htmlspecialchars($job['location']) . '</p></article>';
}
?>
Pro tip: Cache the API response (for example for 15-60 minutes) so the page does not slow down or break when the vendor's API is slow.
5

Improve the iframes you keep

Each remaining iframe needs:

  • a descriptive title attribute for screen readers (WCAG 4.1.2)
  • loading="lazy" if it sits below the fold
  • a short text summary next to it, such as a video transcript excerpt or a written address under a map
html
<iframe src="https://www.youtube-nocookie.com/embed/VIDEO_ID" title="Example Co product demo: setting up your first project" width="560" height="315" loading="lazy" allowfullscreen></iframe>
<p>In this 3-minute demo, we create a project, invite a teammate and publish a report.</p>
6

Stop old iframe source pages from ranking

If your own iframe source URLs (for example /embed/faq.html) were indexed, they can now compete with the parent page. Choose one of these:

  • 301-redirect them to the parent page if nothing still embeds them.
  • Keep them working but send X-Robots-Tag: noindex.

Do not block them in robots.txt. Google must be able to crawl them to see the noindex.

nginx
# Nginx
location ^~ /embed/ {
    add_header X-Robots-Tag "noindex" always;
}

# Apache (.htaccess)
<If "%{REQUEST_URI} =~ m#^/embed/#">
  Header set X-Robots-Tag "noindex"
</If>
7

Check the result and request recrawl

View the raw source (Ctrl+U or curl) and confirm the key text now appears in the HTML response, not just in DevTools. In Google Search Console, use URL Inspection > Test live URL > View tested page > HTML to confirm Google sees the text. Then click Request indexing. Finally, re-run your site audit so the pages drop off the iframe report.

text
curl -s https://example.com/pricing | grep -c '<iframe'
curl -s https://example.com/pricing | grep -i 'Pro plan'
Pro tip: For AI crawlers, the raw curl output is the real test. If the text is not in it, assume GPTBot and ClaudeBot cannot see it.

Platform-specific notes

WordPress

Look for Custom HTML blocks or plugins that output <iframe>, such as some review, menu and job-board plugins. Replace them with native blocks (Table, Details, Heading) or a reusable synced pattern (Appearance > Editor > Patterns). Prefer plugins that render server-side via a shortcode. To audit, search post content in the database for '<iframe' with WP-CLI: wp db query "SELECT ID, post_title FROM wp_posts WHERE post_content LIKE '%<iframe%' AND post_status='publish'".

Shopify

Many apps inject iframes on product pages. Prefer apps that use theme app blocks (Online Store > Themes > Customize > Add block), which render into your theme's HTML. Put specs and size charts in the product description or in metafields (Settings > Custom data > Products) output by your theme's Liquid, not in iframed apps.

Wix

The Embed HTML / Embed a Widget element (Add > Embed Code) always renders inside an iframe, even when you paste plain HTML. Rebuild key text with native Text, Table or Repeater elements, or bind them to a CMS collection. Use Embed Code only for true third-party widgets.

Webflow

The Code Embed element inserts HTML inline, not in an iframe. It only becomes a problem when the pasted code itself is an <iframe>. Rebuild iframed content with native elements or CMS Collection Lists so the text ships in Webflow's static HTML.

Next.js / React

Instead of iframing another app or route, fetch the data in a Server Component (App Router) or in getStaticProps/getServerSideProps (Pages Router). The content then appears in the server-rendered HTML. Avoid client-only fetching for key text if AI crawler visibility matters.

Check that it worked

โœ… How to verify

  • Run curl -s https://example.com/your-page and confirm the key text (prices, FAQ answers, specs) appears in the raw HTML.
  • In Google Search Console, use URL Inspection > Test live URL > View tested page and confirm the text is in the rendered HTML and the screenshot looks complete.
  • Run document.querySelectorAll('main iframe').length in the DevTools Console and confirm only intended embeds such as video or maps remain.
  • Re-run the site audit and confirm the affected pages no longer appear under 'Key content inside iframes'.

โš ๏ธ Common mistakes

  • Replacing an iframe with a JavaScript widget that fetches content client-side. Google may render it, but most AI crawlers and many SEO tools still see an empty container.
  • Leaving the old /embed/ source URLs indexable, so they compete with or outrank the parent page for the same text.
  • Blocking the iframe source in robots.txt and assuming this helps the parent page. It only prevents crawling and does not move any content.
  • Removing useful embeds like videos or maps entirely, when they only needed a title attribute and a short text summary.

Is this still an issue on your site? Run a free audit โ€” ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.

Check my site free

FAQ

Does Google index content inside iframes?

Sometimes. Google can render iframes and may associate the framed content with the parent page, but it does not guarantee this. The content may instead be indexed under the iframe's own URL, or ignored if that URL is blocked or set to noindex. Put text you want to rank in the page HTML.

Are YouTube embeds and Google Maps iframes bad for SEO?

No. They are standard embeds and are fine to keep. Give them a descriptive title attribute, lazy-load them below the fold, and add a short text description or transcript so the page still has crawlable content about the video or location.

Can ChatGPT, Claude or Perplexity read iframe content?

Generally not. Their crawlers (GPTBot, ClaudeBot, PerplexityBot) mainly read the raw HTML response and do not follow iframes or run much JavaScript. Content that only exists inside an iframe is unlikely to be cited in AI answers.

How do I add a third-party widget without using an iframe?

Check the vendor's docs for an API, a server-side SDK or an 'SEO-friendly' inline embed. Render the data into your page on the server. If no such option exists, keep the iframe but publish the most important facts as plain HTML text on the same page.