Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to count number of pages in a space?

Thomas Morcinek August 30, 2022

I would like to know the number of pages that exist in a confluence-space, without a database-query.

I found this similar question : Solved: how to know number of Spaces and number of pages i... (atlassian.com)

But I cannot reproduce the accepted answer.

Can you help me reproducing this accepted answer or is there another solution?

 

3 answers

1 accepted

1 vote
Answer accepted
Rilwan Ahmed
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 30, 2022

Hi @Thomas Morcinek ,

1. Use Database query as mentioned in https://confluence.atlassian.com/confkb/how-to-find-the-number-of-pages-blogposts-and-attachments-in-a-space-720636388.html

2. If you don't have access to DB, I have a workaround. Not a good solution and may not fully as you expect.

Go to your space home page--> Click on "Delete".

A dialogue box shows up with the total number of pages. You can find the count there and click on Cancel

This will not show page count which are not child pages of home page 

image.png

1 vote
Eric S August 30, 2022

Here's a simple user macro you can add:

#set($containerManagerClass=$content.class.forName('com.atlassian.spring.container.ContainerManager'))
#set($getInstanceMethod=$containerManagerClass.getDeclaredMethod('getInstance',null))
#set($containerManager=$getInstanceMethod.invoke(null,null))
#set($containerContext=$containerManager.containerContext)
#set($pageManager=$containerContext.getComponent('pageManager'))
#set($topicCount=$pageManager.getPages($space,true).size())
As of now, the topic count for this space equals $topicCount.
1 vote
Yao Chang Hsu August 30, 2022

I think there are some plugin can do it, such as 

Keysight Admin Tools for Confluence

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events