Cannot edit a page with HTML Macro
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
Problem
Can't edit pages that contain HTML Macro and JavaScript in Confluence.
Cause
JavaScript code in the HTML Macro is the the root cause of this issue.
Workaround
In order to edit the page JavaScript code needs to be remove from HTML Macro and since it's not possible to edit a page through the Editor we can use either of following resolution:
First Workaround:
- Open Confluence HTML Macros from Confluence Admin > Manage Add-ons > All Add-ons
- Expand this macro.
- Disable both html (html) and html (html-xhtml) modules.
- Refresh your page (Open your page in new tab and refresh it there).
- You will see
unknown macro: 'html'
. - Go back to Manage add-ons tab and enable both modules again.
- Go back to the page and click on edit.
- Remove the faulty script and save the page.
Second Workaround:
- Get a copy from your page storage format > Storage Format.
- Disable Confluence HTML Macros.
- Edit the page.
- Remove the HTML Macro with faulty scripts form the page.
- Save the page.
- Since you have got other codes in that HTML macro as well, you can use your storage format's backup to add them back to the page.