How to embed an iframe in Confluence
Confluence Cloud has an iFrame macro that embeds a web page in a page or live doc. You set the URL, height, and width in the configuration panel, not iframe code. The page must allow framing, or the macro stays blank.
3 min read · Updated
- Raw iframe code
- No
- iFrame macro
- Yes
- Needs
- A URL that allows framing
Steps
Step 1: Type / on the page
While you edit, type / and then the macro name to filter the list. You can also find the macro from the editor toolbar.
Step 2: Select the iFrame macro
Select it in the list. Confluence adds the macro placeholder to the page.
Step 3: Select the Edit icon
Select the macro placeholder, then the Edit icon. The configuration panel opens.
Step 4: Set the URL and the size
Enter the address of the page, then set Height and Width in pixels. Set Align, frameborder, and scrolling if you need them.
Step 5: Resume editing the page
Your changes save as you go, and the panel closes. For some macros, use the centered, medium-width, or full-width icons to change the width.
Check your URL first
If the page blocks framing, the iFrame macro shows an empty box or an error.
Limits
The macro has only Height, Width, Align, frameborder, and scrolling. It has no sandbox or allow setting.
The ID, class, styles, title, and name attributes are being deprecated. A change to them has no effect.
The browser can block a website in the macro as a security precaution.
A Smart Link set to Embed shows as an inline link when its domain cannot show as an embed.
The Atlassian guide to paste raw iframe code in the HTML macro is for Confluence Data Center only.
Troubleshooting
- The macro is blank
The site sends an X-Frame-Options header that stops the frame. Only the site owner can change it. Add a link to the site instead.
X-Frame-Options explained- The page does not load over http://
Atlassian suggests to replace http:// with https:// at the start of the URL.
Blank iframe, no error- "Refused to connect"
The site does not allow other sites to frame it. Check the X-Frame-Options and CSP frame-ancestors headers of the page.
"Refused to connect": cause and fix
- Atlassian Support: Insert the iFrame macro (Confluence Cloud) · support.atlassian.com
- Atlassian Support: Insert links and anchors (Confluence Cloud) · support.atlassian.com
- Atlassian Support: How to put an iframe into Confluence (Data Center) · support.atlassian.com
- Atlassian Support: Learn about the features of Confluence Cloud plans · support.atlassian.com