Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,363,014
Community Members
 
Community Events
168
Community Groups

How to count number of pages in a space?

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 vote
Rilwan Ahmed Community Leader Aug 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

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.

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

Atlassian Community Events