How to get the amount of pages with a certain label in Conflunce?

Is it possible without SQL?

I would like to use a plugin or existing Confluence functionality. 

3 answers

1 accepted

I happen to have written a user macro to do this:


## Macro title: Count Labels
## Macro has a body: N
## Developed by: Jonathan Simonoff
## Date created: 8/12/13
## Installed by: Jonathan
## To count labels
## @param Label:title=Label|type=string|required=true|desc=The label to count
## @param Spaces:title=Spaces|type=string|required=false|desc=These are case-sensitive. Separate each item with a comma or single space. Example: SPACEKEY,@personal.  Blank means all spaces. 
#foreach($page in $pagelist)

Should this macro work with all Confluence versions? Because it doesn't seem to work with version 5.9.10. On our Confluence installation I get this error:

Error formatting macro: contentbylabel: com.atlassian.confluence.api.service.exceptions.BadRequestException: Could not parse cql : null

Any ideas?

Regards, Marc

Thanks Lucas and Jonathan. The macro works like a charm

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Confluence

Three common content challenges + how to manage them

An efficient enterprise content management system, or ECM, is a must-have for companies that create work online (cough   cough, all companies). If content calendars, marketing plans, and bu...

29 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you