How to find pages using a specific label in Confluence via SQL
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
Confluence administrators may want to audit Label usage on their Confluence instance. This can be done by using the labelText:
search field.
The alternative approach is by locating a labeled page or post and choosing any label to access the Labeled Content page.
Issue
If viewing and editing restrictions are applied to a page, the page will not be included on the search performed when viewing the Labeled Content pages. This also occurs when accessing with a user who belongs to confluence-administrator group.
In these case, it is possible to get this information from the database using the SQL statements below.
Solution
Make sure you have a backup of your database before performing any SQL query.
Language | Query pages with no labels | Query pages with specific label |
---|---|---|
PostgreSQL |
|
|
MySQL |
|
|
SQL Server |
|
|
Was this helpful?