HTML code in Confluence HTML macro is not working
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
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.
Summary
HTML code in the Confluence HTML macro is not working when the code contains some HTML tags.
Environment
Confluence HTML macro
Diagnosis
Check if the HTML code inside the macro has the below HTML tags:
- <html></html>
- <head></head>
- <body></body>
Cause
Confluence HTML macro already has those HTML tags predefined.
Solution
Remove the above HTML tags then save the page.