How to Get a Listing or Count of Child Pages Under a Parent Page

Still need help?

The Atlassian Community is here for you.

Ask the community

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

  1. Via the UI, by editing the page and grabbing the "pageId" value from the address bar
  2. Via the database, by running:

    SELECT contentid FROM CONTENT WHERE prevver IS NULL AND title = 'Your Page Title';
  3. Run a query below, depending on what you want to do:

    1. 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>';
    2. Getting a total count of pages under the parent

      SELECT COUNT(*) FROM CONFANCESTORS WHERE ancestorid = '<parent_page_id>';

Related pages

 

Last modified on Nov 16, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.