Need DB query to get pages without parents

Matt Donagan August 5, 2022

We recently had an issue where a page had no parent page and it was not showing on the sidebar, although the page was directly accessible. I fixed the issue by "moving" the page and listing the correct parent during the move.

I would like to query the database (Postgres) to see how many other pages do not have a parent page listed, in order to see if we have other pages with the same issue.

I need help with that query.

Thank you

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 6, 2022

The database is not a good way to do this, you'd have to go digging through several different tables, making negative searches (you're actually looking for a record that isn't there, so you'd actually need to be searching for every parent-child relationship and then subtracting that from a list of pages, and then working out which ones of those are root pages and which are orphans)

It is far easier to go to Space Settings -> Manage pages -> Hidden, where Confluence will list them so you can get to them quickly.  

I'm not sure why Atlassian changed the name to "hidden", when "orphan" was more clear (maybe it's only clear to English speakers?).  The URL still has orphan in it, the example I traced through because I wasn't sure where they'd moved it to in the new admin layout was  https://aclsandbox.atlassian.net/wiki/pages/listorphanedpages.action?key=HNM

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events