How to Get a Listing or Count of Child Pages Under a Parent Page
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
Purpose
For purposes of auditing or organization, Confluence administrators may find it useful to see which pages are nested under a given parent page, and how many. This is helpful when examining a large space, to see which branch in the page tree contains the most pages.
Solution
- Via the UI, by editing the page and grabbing the "pageId" value from the address bar
Via the database, by running:
SELECT contentid FROM CONTENT WHERE prevver IS NULL AND title = 'Your Page Title';
Run a query below, depending on what you want to do:
Getting a listing of all pages (pageId and title) under the parent
SELECT c.contentid, c.title FROM CONFANCESTORS a JOIN CONTENT c ON a.descendentid = c.contentid WHERE a.ancestorid = '<parent_page_id>';
Getting a total count of pages under the parent
SELECT COUNT(*) FROM CONFANCESTORS WHERE ancestorid = '<parent_page_id>';
Related pages
- How to find the number of pages, blogposts, and attachments
- How to find pages in Confluence with a certain number of labels