How to get Custom HTML settings from Confluence's database
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs 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"
Solution
Below database query will fetch you the details which are defined under custom HTML
MySQL
1
2
3
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
1
2
3
4
5
6
7
8
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
1
2
3
4
5
6
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:
1
2
3
<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"
Was this helpful?