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

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Is it possible to display some page labels but not others on a page?

I wonder if there is a macro or some other method to display some of a page's labels and exclude others. For example, if a page has labels book, drama, and historical, I only want to display drama and historical since it's already clear from context that this is a book.

I have been using the Page Info macro to list labels, and sometimes the Report Info macro from ServiceRocket's Reporting plugin. Neither one has an option to list some labels but not others.

1 answer

0 votes
Dario B Atlassian Team Nov 07, 2019

Hi @Michelle Rau ,

There is no macro available out of the box to achieve what you are asking for, however, this can be done with a User Macro.

I have create the below one as an example and it works fine on my test instance.  

## Macro title: page-labels-not-in-list
## Macro has a body: N
## Developed by: Dario
## Date created: 7/11/2019
## Installed by: Dario

## @param Label:title=Label|type=string|required=true|desc=List of labels comma separated

#set($labelList = $paramLabel.split(","))

<h2>List all labels for the page, excluding: $paramLabel </h2>
<br />

#foreach($pageLabel in $content.getLabels())
#set($found = 0)
#foreach ($label in $labelList)
#if($pageLabel == $label)

#if($found == 0)
<span class="aui-label">$pageLabel</span>




Can you kindly test it and confirm it works for you as well?



Oooh! I will ask our wiki admins if we can test this.

In the meantime, can you paste a snapshot of what this looks like on a page? That will help me describe to them what it does.

Thank you!

Dario B Atlassian Team Nov 08, 2019

Hi @Michelle Rau ,

Please notice that I just provided a very easy example of a user macro that prints all the labels from the current page, excluding the ones provided in input. 

As it is, the macro is just writing a line of text followed by the list of labels (excluding the ones configured as the input for the macro):



You will have to extend and modify the according to your needs.

You can also modify the way this looks by using JavaScript and CSS. See below documentation for details on how to do so:



Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Confluence

What do you think is the most *delightful* Confluence feature? Comment for a prize!

- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...

402 views 23 8
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you