How to get CustomHTML settings from database


Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. 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

Summary

In some cases, admin may not be able to access the custom HTML page from the UI and will require to get the custom HTML configured in Confluence from the database. This KB outline how admin can run query to get the information from the database, We have DB query which can fetch details under "customHtmlSettings"

Environment

Confluence Data Center

Solution

  • Below database query will fetch you the details which are defined under custom HTML

    MySQL
    SELECT substring_index(substring_index(b.bandanavalue, '<customHtmlSettings>', -1),'</customHtmlSettings>',1)as customHTML 
    from BANDANA b  where 
    b.bandanakey='atlassian.confluence.settings' and b.bandanavalue like '%<customHtmlSettings>%'; 



    PostgreSQL
    select 
       SUBSTRING(SUBSTRING(
        b.bandanavalue,
        POSITION('<customHtmlSettings>' IN b.bandanavalue),
        POSITION('</customHtmlSettings>' IN b.bandanavalue) - POSITION('<customHtmlSettings>' IN b.bandanavalue)) from 21)
     as customHTML       
    from BANDANA b where 
    b.bandanakey='atlassian.confluence.settings' and b.bandanavalue like '%<customHtmlSettings>%';



    Oracle
    SELECT 
     SUBSTR(SUBSTR(b.bandanavalue, INSTR(b.bandanavalue, '<customHtmlSettings>'), 
     INSTR(b.bandanavalue, '</customHtmlSettings>') - INSTR(b.bandanavalue, '<customHtmlSettings>')),21)
    AS customHTML
    from BANDANA b where 
    b.bandanakey='atlassian.confluence.settings' and b.bandanavalue like '%<customHtmlSettings>%';



  • Sample output without any custom HTML defined will be as follows

Sample Custom HTML
    <beforeHeadEnd></beforeHeadEnd>
    <afterBodyStart></afterBodyStart>
    <beforeBodyEnd></beforeBodyEnd>

Please make a note in case you need opening (<customHtmlSettings>) and closing tag (</customHtmlSettings>) to the above output you need to include it.

If you wish to update the customHTML settings , please refer to article Unable to use Confluence upon adding some customizations in "Custom HTML" 

Last modified on Mar 20, 2024

Was this helpful?

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