How to put an iFrame into Confluence

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible


Purpose

An IFrame (Inline Frame) is an HTML document embedded inside another HTML document on a website. The IFrame HTML element is often used to insert content from another source, such as an advertisement, into a Web page.

Although an IFrame behaves like an inline image, it can be configured with its own scrollbar independent of the surrounding page's scrollbar.

Please note that some sites do not work in an iframe. These have cross scripting protection in their headers. For example, Google has

x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block

If these (or similar) are present in the response from the website, then you will not be able to display them in an iframe. Both Google and Facebook are two examples of this. Confluence also has protection to stop itself being displayed. Please see Confluence page does not display in an iframe for more information.


Solution

  1. Log in as Confluence Administrator, then
  2. Go to Manage apps at  > Manage Apps
  3. Search for "Confluence HTML Macros" with "All apps" selected in the dropdown
  4. Under "System apps", click on "Confluence HTML Macros" to expand the app details
  5. Expand the modules in the far-right column
  6. Enable the module called "html (html-xhtml)"
  7. The HTML macro is now available. When creating or editing a page, insert the "HTML" macro:
    1. Go to + (Insert more content) > Other macros
    2. Search for the HTML macro
    3. Paste the following code inside the macro, replacing URL with the website you want to include. Modify the other parameters as you see fit.

      Iframe
      <iframe src="URL" noborder="0" width="830" height="800" scrolling="yes" seamless></iframe>
  8. Save the page


Alternatively, there are apps available that provide similar functionality that do not require the HTML macro, can provide a smaller attack surface, and can provide increased security. Please note that Atlassian does not provide support for these apps but they can be used as an alternative if there are security concerns with the HTML macro.

Description

This document outlines the steps needed to insert an iFrame into Confluence. An IFrame (Inline Frame) is an HTML document embedded inside another HTML document on a website.

Product

Confluence

Last modified on Mar 31, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.