How can I embed a webpage using "iframe src" in Webflow if nothing is showing up?

TL;DR
  • Verify the source URL and ensure the site allows embedding; use Webflow's Embed Element with the correct <iframe> code.
  • Inspect for X-Frame-Options and Content Security Policy restrictions, and test in multiple browsers. 
  • Save, publish, and adjust settings for proper display.

If you're trying to embed a webpage using an iframe in Webflow and it's not displaying, there may be several reasons why it's not working. Here’s a step-by-step guide to address the issue.

1. Verify the Source URL

  • Ensure the URL is correct: Double-check the src URL you are using in the iframe to make sure it's the correct one and that it's live.
  • Check for embedding restrictions: Some websites block embedding through iframes, so confirm that the site allows being embedded.

2. Use the Webflow Embed Element

  • Add an Embed Element: Go to the Add panel in Webflow, and drag the Embed Element onto your page.
  • Insert the Iframe Code: Within the embed code editor, type <iframe src="[your URL]" width="100%" height="500" frameborder="0" scrolling="no"></iframe>. Replace [your URL] with your specific URL.

3. Inspect Browser Restrictions

  • Look for X-Frame-Options: Some sites set a header named X-Frame-Options that can prevent it from showing in an iframe.
  • Test in Another Browser: Try accessing your Webflow site in different browsers to confirm it's not browser-specific.

4. Security and Cross-Origin Policy

  • Check Content Security Policy (CSP): Make sure the site you’re embedding isn't restricted by CSP headers that prevent its content from being loaded in iframes.

5. Update and Test

  • Save and Publish Your Changes: Once the iframe parameters are set correctly in Webflow, publish the site to test if the embedded webpage shows up.
  • Test Different Settings: You might need different height or width settings to better fit the embedded content if the issue is with its display rather than embedding.

Summary

Embedding an iframe in Webflow requires a working and embeddable URL, using the Webflow Embed Element, and being aware of restrictions like X-Frame-Options or CSP. Make sure your settings are correct and test across different browsers once embedded.

Rate this answer

Other Webflow Questions