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

  1. 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.

  2. Step 2: Select the iFrame macro

    Select it in the list. Confluence adds the macro placeholder to the page.

  3. Step 3: Select the Edit icon

    Select the macro placeholder, then the Edit icon. The configuration panel opens.

  4. 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.

  5. 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
Sources

Know before you embed.

Free, no sign-up, nothing stored. Paste a URL and get a verdict, a live preview, and the fix.