HTML Macro

The HTML macro allows you to add HTML code to a Confluence page.

HTML macros are disabled by default

The HTML macro will only be available if it has been enabled by an administrator. Enabling these macros can make your Confluence site vulnerable to cross-site scripting attacks.

Using the HTML Macro

To add the HTML macro to a page:

  1. From the editor toolbar, choose Insert > Other Macros
  2. Find and select the required macro

Speed it up with autocomplete: Type and the beginning of the macro name, to see a list of suggested macros. In this example we're inserting the cheese macro.

To edit an existing macro: Click the macro placeholder and choose Edit. This will open the macro details, so you can edit the macro parameters.

There are no parameters for this macro.

Enter the HTML code into the body of the macro placeholder.

Enabling the HTML Macro

The HTML macro is disabled by default. You'll need Confluence Administrator or System Administrator permissions to enable this macro.

(warning) Enabling these macros can make your Confluence site vulnerable to cross-site scripting attacks. You should only turn on these macros if you trust all your users not to attempt to exploit them. We strongly recommend leaving this macro disabled if you allow self-signed up or anonymous users to create content.

To enable the HTML macro:

  1. Go to > Add-ons.

  2. Select System from the drop down and search for the Confluence HTML Macros add-on.
  3. Expand the add-on and enable the html (html-xhtml)  module.

Wiki markup example

This example is useful when you want to add a macro outside the editor, for example as custom content in the sidebar, header or footer of a space.

Macro name: html

Macro body: Text, consisting of HTML code.

{html}<a href="http://www.atlassian.com">Click here</a> to see the <b>Atlassian</b> website.{html}

Last modified on Oct 16, 2018

Was this helpful?

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