Identifying the macro usage of the Numbered Headings app with an SQL query
This document provides an SQL query to identify the macro usage for the Numbered Headings app.
Instructions
To find the list of pages or the count of pages where the Number Headings macros are used, you can:
Select > Administration > Macro usage to navigate to the Macro usage page.
Use Confluence advance search to look for the pages where a particular macro is used.
Or, run SQL queries like the following in your Confluence database to get the app usage of the macro:
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="numberedheadings"%';
Here is a sample result when the above query is executed.