How to embed an iframe in HubSpot
HubSpot takes full iframe code in a rich text module. Click Insert > Embed and paste the code, or paste it in the Source code view. The page you embed must allow framing, or the frame stays blank.
3 min read · Updated
- Raw iframe code
- Yes
- Embed with a link
- oEmbed links only
- Marketing emails
- Not in rich text modules
Steps
Step 1: Open your content in the editor
Go to your website page, landing page, blog post or knowledge base article. Click its name.
Step 2: Click the rich text module
The module controls open in the left sidebar editor.
Step 3: Click Insert, then select Embed
The Insert dropdown menu is in the left sidebar editor. A dialog box opens.
Step 4: Paste the iframe code and click Insert
Paste the full embed code. Paste a URL only when the site supports oEmbed.
Step 5: Set the size and Iframe loading
Click the embed to set width, height and alignment. Click the Edit icon to set Iframe loading to Browser default, Lazy or Eager, then click Apply.
Step 6: Click Update or Publish
Your change is live after you publish.
Check your URL first
If the page blocks framing, the Insert > Embed in a rich text module shows an empty box or an error.
Limits
A pasted URL works only when it is in oEmbed format. For other pages, paste the embed code.
HubSpot does not support media with added security, such as private YouTube videos.
You cannot embed external media in rich text modules of marketing emails.
An embed that contains a script tag cannot use full width.
You need Edit and Publish permission to change rich text modules on pages and blog posts.
Troubleshooting
- The frame is blank
The page sends X-Frame-Options or a CSP frame-ancestors rule. Test the URL to see which header blocks it.
Blank iframe, no error- "Refused to connect"
The site does not allow other sites to frame it. Only the site owner can change that header.
"Refused to connect": cause and fix- The full width option does not work
Embeds with a script tag do not support full width. For an embed without a script tag, select it and click the full width icon in the toolbar.
Make an iframe responsive
- HubSpot Knowledge Base: Embed an external media file · knowledge.hubspot.com
- HubSpot Knowledge Base: Edit content in rich text modules · knowledge.hubspot.com
- HubSpot Knowledge Base: Add a Google Map to HubSpot content · knowledge.hubspot.com