Documentation for Confluence 5.8 (Server).
Documentation for Confluence Cloud and earlier versions of Confluence is available too.

Skip to end of metadata
Go to start of metadata

The Content by Label macro is used to display lists of pages, blog posts or attachments that have particular labels.  It's great for collecting related pages together and filtering out content that you don't want to see.

For example, you could use this macro to display a list of all pages that have the label 'feature-shipped' and include the word 'Blueprint', or to list any pages with the label 'meeting-notes' that you've been mentioned in.

Here's how the macro looks on your page:

And here's how you would set it up in the macro browser:

Using the Content by Label Macro

To add the Content by Label macro to a page:

  1. In the Confluence editor, choose Insert > Other Macros
  2. Find and select the required macro

Speeding up macro entry with autocomplete: Type { and the beginning of the macro name, to see a list of suggested macros. Details are in Using Autocomplete.

To edit an existing macro: Click the macro placeholder and choose Edit. A macro dialog window will open, where you can edit the parameters of the macro.

CQL fields

This macro uses CQL (Confluence Query Language) to return matching content, such as pages.  You can add as many fields as you need to narrow down your search.  

 Here are some tips...
  • Use the Add Field link to add additional filters to your query. Add as many fields as you need.
  • For an OR search, specify multiple values in the same field.
    So to show pages with 'label-a', 'label-b' or both you'd put 'label-a' and 'label-b' in the same Label field, like this:
  • For an AND search, add more than one field and specify a single value in each.
    To show only pages with label-a and label-b you'd put 'label-a' in one label field, then add a second Label field to the macro, and put 'label-b' in the second one, like this:

    Put simply, OR values are entered in the same field, AND values are entered in different fields. 
    Only some fields support AND.  If the field does not support the AND operator, you won't be able to add that field more than once.  
  • For a NOT search, enter a minus sign (-) before the label. This will exclude everything with that label.

You can use these CQL fields to build your query.  


Include pages, blog posts or attachments with these labels.

OR (multiple values in the same field)

AND (multiple Label fields)

With ancestorNo

Include pages that are children of this page.

This allows you to restrict the macro to a single page tree.

OR (multiple values in the same field)

Include pages or blog posts that were created or edited by these people.

OR (multiple values in the same field)

Include items created by these people.

OR (multiple values in the same field)
Mentioning userNo

Include pages and blog posts that @mention these people.

OR (multiple values in the same field)
With parentNoInclude only direct children of this page (further sub-pages won't be included)EQUALS (one page only)
In spaceNoInclude items from these spaces.OR (multiple values in the same field)
Including textNoInclude items that contain this text.CONTAINS (single word or phrase)
With titleNoInclude items that contain this text in the title.CONTAINS (single word or phrase)
Of typeNoInclude only pages, blogs or attachments.OR (multiple values in the same field)

Macro display options

These options control how the macro appears on your page.

Sort byModified

Sort the list by title, the date it was created or the date it was last modified.

Reverse sortFalseSort the list descending instead of ascending (Z - A, earliest - latest)
Maximum number of pages15Limit the number of items to include in the list.
List titleBlankInclude an optional heading for the macro
Show labels for each pageTrueShow or hide the labels applied to each item
Show space name for each pageFalseShow or hide the space name for each item
Display excerptsFalseShow an excerpt from the page or blog post (the page or blog post needs an excerpt macro to be able to show an excerpt).




  1. Anonymous

    I would like the output to be just the page names as links, separated by spaces.  No icon, no "new line", no Space or Labels.  In this way I can, for example, create a table and fill a cell with links for a label-defined collection of pages.  A very dense way to build a reference page to items for sets of topics. Please!?

    Is this doable as a user macro?  Would the current source be a big help?

    Thanks! - Tom Evans 

    1. Anonymous

      Here is a great example of how this capability would be used:

      The front page of this Enterprise Architecture site gives instant access to a large set of standards, organized by category.  A perfect use of  labels and content-by-label.  If these links were listed as one-per-line this Front Page would be three pages long, at least.

        • you could use the reporting plugin (if it's installed)
        • you could use this horrible user macro hack below. Uses metadata-report from the metadata plugin. By using metadata-report, you can use basic label logic, i.e. 'software+documentation' requires both labels. you could alter it to wrap the built in contentbylabel aswell.
        • the trimp and render velocity template definitions may not be needed if they are declared elsewhere
        ## Macro: contentbylabel2
        ## Macro does not have a body
        ## Macro returns HTML
        #macro(trimp $xhtml)
        ## remove leading <p> and trailing </p>
        #if($xhtml.startsWith("<p>",0) && $xhtml.endsWith("</p>"))
        #macro(render $wiki)
        ## render $wiki in wiki renderer
        #if($content) ## i. e. we render a normal page
          #set($xhtml=$renderer.convertWikiToXHtml($context, $wiki))
        #else ## we are e. g. in Global Template Preview
        ## Get parameters
        #set($delimiter=" ")
        ## retrieve pages with those labels (uses metadata-report for now)
        ## pull out just urls, skipping first array element
        #set($hrefs=$html.split('<a href='))
        #foreach($href in $hrefs)
        #set($href="<a href=$href.substring(0,$index)")
        1. Anonymous

          Wow. Thanks!

          This client site needs to get through an upgrade first (2.0.2 -> 2.7), so I won't be reporting success for (at least) a few weeks, but its great to see a solution, and community support in action.  - Tom

          1. Your problem has likely long been solved, but for folks looking for the source, it is available at:


  2. Is there anyway to do some kind of exclusion criterion? say

    The practical application would be having a set of documents on varying yet very similar topics, wanting to display all except a particular subset that is flagged for review. Since I'd need to use more than one set of labels, I'm hard pressed to say ONLY dogs and reviewed, as I need cats as well, so setting the AND operator doesn't catch all the content, and OR sets the net too wide.

    1. You can do it with the Reporting Plugin. The 'labels' parameters on several macros there will let you specify "+" or "-" for "required" and "excluded", respectively. So, for example, you could do this:

      {content-reporter:space=+@global, -EXCLUDED|labels=+dogs, +cats, -needs_review|type=page}

      Which would basically give you all pages in all global (non-personal) spaces except the one called 'EXCLUDED' which have the 'dogs' and 'cats' label, but do not have 'needs_review'.

  3. Anonymous

    I see where the type "page" and blog-post" work, but I dont; see a full list fo other "types"

     in the search macro documentation I see a list of types- but they don't seem to be consistent -- I see "userinfo",  but I can't get any of these to work using this contentby label macro:

    userinfo, user-indo, user, users, profile, profiles, user-profile....

     in the search macro I see "blogpost" type but in this macro it is blog-post...  Is there some consistency that will be achieved here at some point? what types does this macro support right now? if not all- why?

    1. Hi,

      For Content by label macro, it's different with the space macro whereby it lists content with tagged labels. That means, it could be either page or blogs post. Having said that, labels work in pages and blogs post. In this macro, the "blogpost" type is used. For example:


      Hope this helps. Thanks.


  4. In Conf 2.7.3, if no content in the space in which you were searching didn't have the label (e.g. labelx) you were looking for, the macro would return the text:

    No content found for label(s) labelx.

    In 2.10.1, the macro returns

    contentbylabel: 'labelx' is not an existing label

    This text is also highlighted in red and looks like a system error to the user.

    What can be done to fix this back to the way it used to be?

    Wiki markup:

    1. Bug reported to Atlassian: CSP-27601

      1. Hi Tomi,

        We are having similar problem with confluence 2.6 and confluence 2.10.3. Any update on this issues? I can not see the issue CSP-27601.


        1. Hi Vinay,

          We are having similar problem with confluence 2.6 and confluence 2.10.3. Any update on this issues?

          I have double check the issue CSP-27601. However, there is not much information in that issue. Also, I believe that the warning information is fix in plugin version 1.5.5. I have personally tried this, an it display same as in Confluence 2.6. Please give it a try.

          Hope that helps,
          Best rgds

  5. I'd like to create a "Related Topics" section on a page that lists the pages that are related to the current page using the page labels as the associative element. If I'm reading the documentation correctly, the contentbylabel macro requires a label or labels as a parameter. It seems odd to have to provide labels as input to the macro, when I've already added labels to the page. Is there any way to have the contentbylabel macro use the current page's labels as the value of the label/labels parameter? I'm using Confluence 2.8.2, but plan on upgrading to the latest release soon.


    1. Hi, David. If I am not wrong, you can use the {related-labels} macro to achieve this. Hope that helps!

      1. I believe the {related-labels} macro produces a formatted listing of labels related to the labels used on the current page. I'm looking for a formatted listing of pages like the one provided by the {contentbylabel} macro, and the listing should contain the pages related to the labels on the current page. If I were to use the {related-labels} macro, and somehow feed those results to the {contentbylabel} macro, I'd end up with a much larger listing of related pages, sort of an extended family of pages.

        1. David, I wanted the same thing and just recently created the following user macro: that I believe suits your needs.

          1. Anonymous

            I was looking for the same thing and this user macro did the trick - Thanks.
            Maybe the staff can add this information on the bottom of the page (So it doesnt get lost in comments) (smile)

            1. Glad the user macro worked out for you. Let me know if there's an additional feature you'd like to see supported.

  6. I've added this macro to a number of pages, but I get "No content found for label(s)" all the time, evn though I know results exist for the search. I've tried rebuilding the index, but that doesn't help. Any suggestions?

    1. Hi Christian,

      If you are using 2.10, then by default the macro will return matches from the current space only. You can specify which spaces to include results from by using the 'space' parameter, or just add 'space=@all' to return results from the entire site.

      If that is not the problem, I would suggest raising a support request at


    2. Try:

      {contentbylabel:yourlabel|...everything else...}

      Did it work? (big grin)

      1. Anonymous

        Thanks for this advice :) I also had the "No content found for label(s) ." The problem was i used macro in this form contentbylabel:label=....  I have corrected to contentbylabel:mylabelname and i works!

  7. Anonymous

    i am trying to create a unique space, and have a content lst for the user that is logged-in.  Is this possible?

    I am running stand-alone evaluation, v. 2.10.

    thnx for your help!!!

    1. Hi there,

      I believe that Pagetree macro can help doing a content list in space. For further detail on how to use Pagetree macro please refer to this page:


  8. Anonymous


    I'm using this macro as follows in Confluence Team Hosted 2.10.1:

    There is no content with the specified labels

    It seems to work fine in that it shows pages which do not have label done plus have MB and PCI labels, and policy, process or procedure labels.

    However it also lists pages that have a text value of policy, process or procedure but no labels of the same values (and which do not have label done plus have MB and PCI labels). So it seems to be searching the whole page, not just the labels.

    Am I doing something obviously wrong here?



    1. Anonymous

      Macro code is



    2. Hi Melissa,

      I noticed that you have already raised a support ticket in our support channel. We will proceed in keeping track of the progress of your issue through your support ticket.

      Henry CL Tiong

      1. Thanks Henry. I actually have a question about the documentation on this macro, which says:

        "To indicate that the results must match at least one of the specified label values, simply list the labels separated by commas. For example: If you specify a label value of -badpage,goodpage,superpage you will get content which has a label of either 'goodpage' or 'superpage' (or both) but does not have the label 'badpage'."

        I am possibly misunderstanding the meaning here, so need some clarification.

        If I have a content by label macro that specifies 'label=-ZZ,+AA,+BB,CC,DD'

        my list should show pages that don't have label ZZ, that have labels AA and BB, and also have label CC or DD (or both)?

        And further, if I have some pages with labels AA and BB, which do not have labels ZZ, CC or DD, should these show up in a content by label macro list that uses the above label specfications?


        1. Hello Melissa,

          I'm just confirming that your presumption is correct.

          Hence, if you had AA,+BB,+CC,DD,EE,-FF, then the parameter to which this applies:

          • must match BB AND CC
          • must match ONE OR MORE OF: AA, DD or EE
          • must NOT match FF

          Bear in mind that this principle applies to several of the parameters above: label, author, etc.

          Hope this clarifies the situation.

          Best regards,

          Giles Gaskell
          Technical Writer

          ATLASSIAN -

            1. Hello Melissa,

              While the information I wrote above is still true, I received some additional information about the operator parameter, which if used in conjunction with the label parameter, affects non-prefixed label values (i.e. labels without a '+' or '-' immediately preceding them). I don't know if this affects your situation, but it's worth mentioning because the behaviour is somewhat complex.

              Hence, if you had:

              labels=label1,label2,label3|operator=OR (this is the default behaviour of the operator parameter, which is the same as if it were not used in the macro at all)

              then your content must have one or more of the 'label1', 'label2' or 'label3' labels.

              If you had:


              then your content must have all three 'label1', 'label2' and 'label3' labels.

              If you intend to use the label parameter with '+' or '-' signs prefixing any of its label values, then avoid using the operator parameter in the same macro to minimise confusion.

              The operator parameter is available to provide support for Confluence content which was written using older versions of the Content by Label macro, when at the time, the operator parameter was the only mechanism available to implement logical operations on a set of label values.

              The documentation above has been updated with this new information, so I hope this information helps.

              Kind regards,

              Giles Gaskell
              Technical Writer
              ATLASSIAN -

              1. Thanks Giles, that's good to know.

                Am a little confused though, as my support incident about this macro was closed recently, with the finding by Atlassian support being that the default OR operator functions to show '0 or more' labels, not '1 or more'. The documentation on this page was updated to reflect '0 or more', but I noticed it's now changed back to 1 or more. And in my Confluence Team Hosted instance it's definitely working as 0 or more (which I must say is not a particularly useful function to have - 1 or more makes much more sense!!).

                I've pretty much given up on this issue, but thought I'd mention it again as a) I'm sure you guys want the doco to be accurate, and b) '0 or more' functionality is basically useless, and might warrant further investigation...?


          1. It is not behaving that way for me.  When I have AA, BB, +CC it appears to be doing:

            • must match CC
            • can match AA, BB or neither
            1. Anonymous

              No response from Atlassian on this?

              1. Hi there,

                Please raise a support request or submit a question to Atlassian Answers. There, our support engineers will be better able to assist you.

                1. I asked the question on Atlassian Answers.  I am seeing the same results as Charles, where the non-required labels become optional once you specify a required label.  Hopefully someone can answer.

  9. Hi, is it possible to sort related contents by the number of tags related to the current content.


    1. Hi agehl,

      I am afraid that this is not possible since the above {contentbylabel} macro and {related-labels} macro do not support any parameter to do this.
      If you are keen to have this feature in Confluence, feel free to raise an improvement request at

      I am not sure whether this will be helpful, however, there are some other macros such as popular-labels and Tagcloud Macro that you might want to try.


  10. Anonymous

    I am hoping to ask the user a series of questions and, based on their response, vary the labels that a checklist is filtered by (i.e. pass a variable into the checklist function). Is this possible?



    1. Hi,

      If you are referring to the checklist plugin. It seems that the parameter which determine the label used, does not support multiple labels. I would suggest you to direct your question to the author as I believe that they know more on the plugin than us.

  11. Anonymous


    is it possible to not show the message "No content found for label..." if nothing was found?



    1. Hi,

      You can try to edit for the following key As the file is inside confluence-advanced-macros-x.x.x.jar, you need to unjar and rejar it back again. You can refer to the following doc:


    2. GuL

      We found a workaround solution for this, as we don't want to see the "no content found for label...", too.

      We have created a user macro, which simply get's this error message before rendering the html-code of the page and then replaces this error message string by a string defined inside the macro (possibly could be optimized by using a parameter for the new string).

      Using the macro you can output whatever you want, e.g. also an empty string.

      Here's our macro code, hope it helps.


  12. Anonymous


    Can I fix some labels on a page in confluence such that only space admin or some restricted group can only delete it.

    I mean i want to fix just few labels for a page at the same time allowing user to play with other label i.e. they can add/remove more labels but can't change the fixed labels.


    1. Hi,

      As far as I know, the feature requested is not available yet. However,I found a feature request which might be the closest to your requirement:

      If you are less happy about the feature request above, you might want to raise an improvement/feature request in JIRA:

      Please add your comments to the discussion, vote on it and add yourself as a watcher for future updates. Also, please bear in mind the following document on how we schedule features for inclusion in our products: Implementation of New Features and Improvements.

      Hope that helps.
      Best rgds,

  13. This post was also posted on the related content user macro page

    I have to categories of content in my space: topic and case. The pages are labeled "topic" and "case" respectively + labels describing the content, and are sorted in to separate page hierarchies. I want to list related topics in a page:

    The problem is that the above code renders a list with all pages having the "topic" label. The "topic" is not just a requirement, as I thought it was. Is it possible to render a list of pages within one page hierachy with related labels instead, and not just within the whole space?

    1. Hi Lars,

      I hope your question has been answered in the following pages:

      And yes you are right about the {related-content} macro that you can only restrict the macro to search a set of spaces or all spaces.

      Hope this will help others too.


  14. Anonymous


    I am looking at using this macro to return a list of pages with a particular label on them. However, I would like to display the page author, the creation date and the modification date along with the page title. Is this possible? I have tried using the reporter macros, but they run too slowly for us.


    1. Hi,

      I am afraid that this is not currently possible. Feel free to raise an improvement request at and describe in detail how you require this feature to work. Please add yourself as a watcher, vote for this improvement and add your own comments to this improvement request. For further details on how we include new features and improvements, you might want to read this page

      As far as I know, the reporting plugin should be able to do what you require. Perhaps, you can post the problem you are having in their issue tracker so that you can get a workaround or solution. You could also get more help in Atlassian Answers.


  15. Hi,

    I have created several "primary" pages and then a bunch of "secondary" pages.  I have taken the secondary pages and moved them to be children of the related primary pages.  I'm trying to use "space=@self" in the primary pages to display links to the children.

    This is what I'm using:


    The problem is that for some reason that I don't understand, all of my secondary pages show up as links instead of the one single document that I've moved to be a child of the primary page.  I've turned the showspace to true and there isn't a space name... odd. 

    Can anyone please help me?

    Update: okay, I think I've figured out that all of the pages have the same "space" and that's why they're doing this... that doesn't help me solve the problem yet though.

  16. I'm trying to use this macro to return page with a combination of labels.   We have been labelling our pages with a "type" (standard, procedure, etc) and a domain (network, server, database)  - I can't seem to get the macro to return all pages for example that have both a "network" and "standard" label.   I want the results to be similar to the results I see when I click on the network label and then click on the "standard" related label and the list shows all pages with both labels applied.

    I hope I made it clear.  What I get right now  from this:

    Is a listing of all pages with either "network" OR "standards" label.



    1. Hi Dave,

      Use the 'operator' parameter and set it to 'AND'.


      {contentbylabel:labels=network,standards|title=Network Standards|max=5|excerpt=true|sort=modified|operator=AND}


      1. GuL

        Another option is to add a '+' before each must-have-label.



        1. Thanks guys - both of those worked!


  17. Anonymous

    I would like to categorize Wiki content based on labels that follow a certain pattern, such as "", "", "bar.baz.1", etc.) and then create reports listing subsets of pages that match similar patters, such as "foo.*", or "*.bar.*" etc. There could be a fairly large number of such labels (dozens).

    I don't suppose it's possible to use some sort of a globbing pattern or regular expression as the name of the label in {contentbylabel:label=RE}, is there? If not, is there already a feature request for this ability or should I create one?

    1. Hi,

      I am afraid that this is not currently possible. Feel free to raise an improvement request at and describe in detail how you require this feature to work. Please add yourself as a watcher, vote for this feature and add your own comments to this request. For further details on how we include new features and improvements, you might want to read this page


  18. Anonymous

    Is there a way to get the macro to produce a number representing the number of records matching the query instead of the list of results? I'd like to be able to use the results in tables and charts. Like so:

    and have it rendered like so:

    Number of Pages To Fix

    Number of Pages Fixed



    1. Hi,
      Unfortunately, the feature that you are after is not available. Please feel free to make a feature request under Confluence project at is where our programmers keep track of the bugs, task, feature & improvement request, etc. Please share your comment by creating a new issue, vote on it, and add yourself as a watcher for future update.

      As a workaround, I'd suggest to query the content label from database via Confluence SQL Plugin. The tables you need to look into are label and content_label. We can link these tables via labelid and group by labelid to count the usage of each label, for example:

      SELECT as Label_Name, count(1) as Label_Usage
      FROM confluence.label l, confluence.content_label c
      where l.labelid = c.labelid
      group by c.labelid;

      Simply call the query above with Confluence SQL plugin, and it will give you a nice chart on the Label count. If you face any difficulties in using the SQL plugin, please feel free to create a support ticket at

      Hope it helps. Please feel free to ask if you need further assistant.

      Thanks & regards,

  19. it looks like your space or spaces parameter is set to "key", while it should be set to and existing space key, several keys, or a special operator (e.g. @all or @self)

  20. Is there any way to retrieve which users have used a personal label? Preferably from the PROFILE page but Personal Space is OK too. 

    {contentbylabel:labels=my:project|spaces=@personal} does not seem to do the trick. 

  21. I would like to use Content by Label to populate table of contents sections dynamically, but I need the links to appear as bullets, as in a table of contents.

    Can someone suggest a snippet to help me display the results of content by label in a different way?

    1. Hi Matt,

      Not sure if this is what you wanted, but you can tweak the stylesheet to suit your needs. In order to do this, go to Dashboard > Administration > Look and Feel > Global Stylesheet and enter the following:

      Feel free to change the code. Hope this helps.


      1. JSashi

        Thanks for your reply.

        OK - I tried it out - and it does change the way the items are displayed, so that's good. But I cannot remove the tiny underlining, and the bullets are out of synch with the text because of the underlining. I want to display the results of contentbylabel as TOC entries with links, NOT as attachments.

        Is this snippet only going to change the way contentbylabel results are displayed? I don't want to break anything else.



        1. Hi Matt,

          I am not able to understand the problem right now. Perhaps the Confluence version you are using might be displaying it differently. Could you tell me the version of Confluence you are using and also the exact code for the {contentbylabel} that you are using. You can also ask a question on Atlassian Answers and attach some screenshots of the problem/requirement that you have. Once you have done that, please comment back here with the forum link.


  22. Hi there were using Confluence 3.1 and would like to be able to display labels on a page which then link through to a list of pages which have all used the label.

    Is this possible?

    I've tried using the Contentbylabel macro but this displays content rather then the labels themselves.

    1. Hi James,

      I think the Labels List Macro does what you want.

      If not, there are other options listed at Using Label Macros to Categorise Wiki Content.


  23. Anonymous

    This macro is almost perfect for my needs except that I want to "sort by natural page order". I either get alphabetical, create or modified date.My goal is to show subsets of children pages by use the inherent page order ability of confluence.

    Any suggestions?


    1. Anonymous

      I was wondering if you found a solution to this ? I have the same issue. I really want to report on the order of the pages within the parent page..


  24. Anonymous

    Is there a way to use wildcards with contentbylabel?  I'd like to list all pages with labels that start with a certain string.

    1. I'm afraid that's not possible. You may get this sort of error:

      1. Anonymous

        are you planning on implementing this feature?

  25. This is a great macro, but if I only show 15 of 19 results, how do I let my users see the rest? 

    Seems like we need "More..." like the {recently-updated} macro uses.

    1. I strongly agree... This macro is powerful, but I have no way of knowing ahead of time how many pages would be returned by the search.  A "more" button would be a big help!

      1. Anonymous

        I agree too!

    2. Anonymous

      100% agree - this is a pretty severe failing in this macro.

  26. Anonymous

    I would like to a see a parameter to add the ''last editted'' date to every page in the list of this possible?

  27. Anonymous

    Can we please get NOT or ! supported as a Operator?  That would add huge value to this macro.

  28. Anonymous

    Opened a ticket for the NOT operator, please vote for it if you need it.


  29. Anonymous

    Was wondering if there was any way of breaking a long list of labels into two columns using the same label so that it's easier to read the list, haven't been able to find anything but hopefully somebody might know something I don't know.

  30. Anonymous

    Sort by label would be fantastic!

  31. Is there anyway to use another macro within contentbylabel?

    What I want to do is a dynamic view, i.e.:


    So this would render a contentbylabel always based upon the labels = title of the page.
    Any ide on how to solve this?


    1. Hi Mr Tilly.

      I think this is the solution you looking for:


      I hope its useful.

      //Johan Hellstrom

      1. Works like a charm!




  32. Anyone have some guidelines as to what style properties I can use to change the appearance of the label list? For example, I'd like the Labels to show up under the related page, but in a light gray rather than the standard link color.

  33. Is the source code for this macro available somewhere? I searched a few spots and could not find it. THanks!


  34. Anonymous

    It looks like there is a bug with the Display Excerpts option when used within the Column macro. I haven't solidified the cause completely it seems to happen only when the excerpt is large or has some special characters. Whatever the case is I find the content derived from the Content by Label macro can return data that will spill out of the column bounds. In this example I have two columns. The first is set to 75% and the second to 25%. We can see tables show up inside the excerpts and the column widths are ignored. Sorry the comment is so large, it was hard to find confluence content that would demonstrate this problem.  Any ideas on a workaround?



  35. After adding the 'Content by Label' If you receive an error saying no content available, go to Confluence Admin -> Content Indexing and rebuild the search index.

  36. Anonymous

    This option as well as the navigation map should be available for spaces not only for pages!


    Is there a way to do the following in teh content by label macro:

    Show pages which have (NOT AA) AND (NOT BB OR NOT CC OR NOT DD).  I am trying to do a control list to check all pages within a space have one of BB CC or DD labels, ignoring those which are in category AA.









    Is there a way to format the listed content so that it doesn't show the icons? 

  40. Three way to do that :

    • Use JS to hide icon
    • Modify the macro in source code
    • Create a new user macro
  41. Recently i created a bug report where you sometimes get a error: "Error rendering macro 'contentbylabel' : null"

    CONF-30009 - ContentByLabel macro sometimes give: "Error rendering macro 'contentbylabel' : null" Resolved

  42. Anonymous

    Is it possible to use a variable for "SpaceKey" in the field for Label(s)?  I would like to create a Content by Label macro that will pull any content labeled with the SpaceKey for the Space that the macro resides in.  Is that possible?

    1. You can use "@self" at SpaceKey, Think that is what you want (wink)

      1. Peter, thank you so much for the quick response.  But unfortunately, that does not seem to work.  I get the following error message when trying to view the macro.  

        Error rendering macro 'contentbylabel' : com.atlassian.confluence.macro.params.ParameterException: '@self' is an invalid label.


        Any other ideas?  Am I doing something incorrect?  Thanks again for the response.

        1. Seems like you try to fill in "@self" at labels, but this should be at "Restrict to these Spaces".

          1. Peter,

            Sorry for being unclear.  The content I want to view is actually in another Space, but the specific Page we want to include in the Content Macro is labeled with the Space Key.

            For example, there is a Page with the label "ACME" in the "Open Projects" Space.  I want to be able to use a Content Macro to view any Pages with the label "ACME" in the "ACME Company" Space with Space Key "ACME".

            Does that make any sense?

            1. In that case just use the label "acme" (labels should always be lower case) and just "ACME" at Restrict to these Spaces

  43. Anonymous

    The formatting of the result list is realized in the moment with divs containing the pagelink and a span-element containing the excerpt-entries. On the one hand it's a little scary to see a excerpt list with pagelinks of different length since the excerpts don't start ordered as I would expect in tables or divs with right margin. On the second hand the excerpt wraps under the pagelink when some more complex content is embedded like a simple paragraph.

    I would suggest to improve the display using div's only - either with float/margin or with display:table-cell as you announced in the 5.2 release for the general table design.

  44. Anonymous

    Is it possible to have the macro display the number of items that are returned?

    If I set a limit on the number of results, the macro will display "Showing xx of xx results" when it hits the limit - but it doesn't offer me any way to expand the list to view the rest of the items. 

    So, I would like to be able have the "Showing xx of xx results" viewable even when the limit of items has not been reached.

    My end goal is to have a dynamic counter of results returned for a table. 

  45. Anonymous

    I must be doing something wrong with this macro because no matter what I set the "Maximum Number of Pages" to, it still only shows me at most 6 of my 7.  Ideally this macro would list all of the pages with the matching label.


    I added and labeled the seventh page after the macro had already been placed on its home page.  Is there something I need to refresh to get it to work properly?

  46. Following on this comment above, is it possible with AOD Confluence to have the Related Content by Label set so that it searches for the labels already attached to @self? I tried using @self in the Label(s) field for this macro and the Content Report Table, but neither accept it. Other workarounds?

  47. I tried using this on Confluence 5.4, in a page with label "vpn", and the macro specifying the label "vpn". The list of Related Articles contains the page itself... which seems undesirable in basically all cases. Is this expected behaviour? I would have thought the list should always exclude the page in which the macro is executing.

    1. Listing it's own page when the page contains the label is the normal behaviour of the macro. There has been an improvement requested on CONF-5245.


  48. I'm using this macro, and noticed something odd.  At the bottom, it displays "Showing first 5 of 6 results."

    For some reason, there's no active link to get to the 6th item.  I noticed above in the example "46 related results" that is an active link to the rest of the results.

    I went into the macro options, and don't see anything controlling this functionality.  What am I missing?

    1. Hi Peter, what version of Confluence are you using?  The way results are paginated may changed.  

      The parameter that controls the number of matching pages to display is 'Maximum Number of Pages'.

      1. Version 4.3.7.

        I had set the max # of pages parameter to 5.  And it shows 5.  However, I have 6 pages.  It even indicates that 5 of 6 pages are displayed.  But there's no 'next page' or 'see more' active link to allow me to get to the 6th page if I want to.

        What I've done to get around this is actually create a whole new sub-page, using the same content by label macro, with the page setting to 9999, so it shows all 6 pages.  I then went back to my original page and added a 'see more' page link to the sub-page so I can get to all pages, not just the 5 I want to display on the main page (saving space).

        1. Hi Peter, sounds like that might be a bug in version 4.3.   The example above is from Confluence 5.6 which does not paginate the results, but instead provides a link to the full list of search results. 

  49. After I use the Content by Label macro - is there a way to organize the results in a hierarchy? (At least in the original hierarchy in which they appear in the originating space.)

    Is there any other way to organize the pages that come up with the label?

  50. Hi there,

     I can't find any documentation on this issue.

    When we use this macro, we occassionally get duplicates in each list. Is this a known issue? Is there a workaround?


    Like, if I run content by label, it lists the same page multiple times.

    • Page A
    • Page B
    • Page B
    • Page C
    • Page C
    • Page D
  51. We have Confluence 5.6.4 and our Content By Label macro has stopped recognising new labels. Existing labels can still be returned but any new labels are not recognised. Could someone suggest a fix for this?

    1. Hi Dan, you should contact support directly about this.  Sounds like something is not quite right, but I see that an issue has already been raised about it. Support will help you troubleshoot and raise a bug if necessary.