Unable to use Confluence upon adding some customizations in "Custom HTML"

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

A blank page is displayed when Confluence is accessed through the browser right after adding customizations within Confluence Admin >  Custom HTML

Diagnosis

Please try to access the Confluence Admin page using the URL below. If you do not receive a blank screen, remove the customizations, otherwise proceed to the resolution.

  • https://<Confluence URL>/admin/viewcustomhtml.action

If you are able to access the link above, please read the KB article: Customized HTML Breaks the 'Edit Custom HTML' Page

Cause

One of the many causes that result in Confluence to presenting a blank screen is when a <script> tag in your Custom HTML is open and not properly closed. Other problems in the custom code can also cause this behaviour.

Resolution

As the Confluence UI is not usable, the customizations in "custom HTML" need to be removed through the Confluence database directly. Before proceeding, please ensure that you have a full backup of your Confluence database.

  1. Shutdown Confluence
  2. Run the following SQL query and copy the full output to a text editor, it returns a long XML output with several settings:
  3. SELECT bandanavalue FROM bandana WHERE bandanakey = 'atlassian.confluence.settings';
  4. On the text editor, locate  <customHtmlSettings>...</customHtmlSettings> tag as it contains the customizations added to Custom HTML.
  5. To reset this, you need to remove the customizations added, and your customHtmlSettings should look like this:
  6. ...
    <customHtmlSettings>
        <beforeHeadEnd></beforeHeadEnd>
        <afterBodyStart></afterBodyStart>
        <beforeBodyEnd></beforeBodyEnd>
     </customHtmlSettings>
    ...


    1. (warning) Make sure all the tags are complete and properly enclosed, and you have only removed the added codes and not changed any other part of the output.

  7. After that, you need to update your Confluence database with the modified settings. To do that you need to build the following query:

    1. (info) You must copy the whole XML block containing the modifications to remove the custom HTML code. Replace that block on the query bellow accordingly:

  8. UPDATE bandana SET bandanavalue = '<modified_settings>' WHERE bandanakey = 'atlassian.confluence.settings';
  9. Start Confluence


Last modified on Jan 11, 2022

Was this helpful?

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