How do I add HTML to a page on Confluence?

Rajeev Desai February 28, 2023

Hi,

I'd like to add HTML code to a page on Confluence. Are iframes a good macro to use? I was also looking at code snippet but it could be just a visual tool and not embedding it into the page.

Thanks.

Regards,

Rajeev

2 answers

1 vote
Patricia Modispacher _appanvil_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
April 25, 2024

The question is a bit older, but the need is the same: Currently there is no Confluence built in macro for the cloud that allows you to embed HTML into your page. But there is the macro suite Aura Content Formatting Macros. 🌐

Using Aura, you can embed HTML, CSS and JavaScript completely intuitively and quickly - previews are displayed in real time. ⚡

 

image-20220329-203842.png

Another advantage of Aura for you is that Aura is not just the one HTML macro, but a whole macro suite that provides you with a wealth of tools to elevate your Confluence pages. From dynamic content and status macros to cards, panels, colors, tabs, titles, and much more, Aura empowers you to create truly exceptional Confluence experiences.

You can try it for free! ✨

 

 

0 votes
Dominic Lagger
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 28, 2023

Hi @Rajeev Desai 

Confluence Cloud allows users to insert HTML code using the HTML macro. The HTML macro is not enabled by default, so you'll need to have your Confluence administrator enable it first.

Once the HTML macro is enabled, you can add it to a Confluence page by doing the following:

  1. Go to the page where you want to insert the HTML code.
  2. Click on the "Insert more content" button (+ icon) in the toolbar.
  3. Select "Other macros" from the dropdown menu.
  4. Type "HTML" into the search bar and select the "HTML" macro.
  5. Insert your HTML code into the macro editor.

Regarding iframes, they can be used to embed external content, such as videos or maps, into a Confluence page. However, it's important to note that some external content providers may not allow their content to be embedded using iframes. Additionally, iframes can potentially pose a security risk, so it's important to only use trusted sources.

The code snippet macro is another option for adding HTML code to a Confluence page. It allows you to display code snippets with syntax highlighting, but it doesn't actually execute the code. If you're looking to embed external content or execute custom code on your Confluence page, the HTML macro may be more suitable.

Regards, Dominic

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 1, 2023

@Dominic Lagger 

The built-in HTML macro that was available in Confluence Server/DC is not available in Confluence Cloud. Alternate macros have to be used to insert HTML code.

@Rajeev Desai 

Which alternate macro is best for you depends on the varieties of HTML code you might want to insert.

Like # people like this
Greg Wenden November 14, 2023

I'm looking to add the Google Analytics script to my Confluence pages. There are, older, websites giving instructions as to how to do this, but they don't seem to be applicable now.

How do I embed the script into the page rather than adding it as content?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 14, 2023

Hello @Greg Wenden 

Your question is not the same topic as the original post. Please start a new Question and provide information about your environment (i.e. hosting type, plan/version).

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events