How to retrieve usage information of HTML for Confluence

Overview

This article explains how to retrieve the usage information like the Confluence page titles, spaces, etc. where the HTML macros are used. 

Instructions

Usage information through database query:

Run the following query in your database:

SELECT c.contentid, c.contenttype, c.title, s.spacekey
FROM CONTENT c
JOIN BODYCONTENT bc
	ON c.contentid = bc.contentid
JOIN SPACES s
	ON c.spaceid = s.spaceid
WHERE c.prevver IS NULL
	AND c.contenttype IN ('PAGE', 'BLOGPOST')
	AND bc.body LIKE '%ac:name="html"%';

If the query returns any records, it indicates that the HTML macro is being used and it displays the page title as: 


Usage information through SQL for Confluence:

Alternatively, if you have the SQL for Confluence app installed in your Confluence instance, you can run the mentioned query directly on the Confluence page using the SQL macro, which returns the following results: 

Test this scenario in a staging environment first before running it on a production instance.