More flexible commenting in Atlassian’s Confluence

Confluence users often ask me how the Confluence permissions model works. A reoccurring theme is the ability (or lack thereof) to selectively show or hide comments in a space on an ad-hoc basis.

The current feature set of Confluence allows you to either enable or disable comments on a per space basis. For some users this can seem overly simplistic. Though we don’t really want to change the way that Confluence works under the hood, perhaps we can give the appearance of a more granular commenting permissions model. In this way, CSS can be used to show or hide the comments block.

There are 2 ways of approaching this problem.

  1. Enabling comments in a space and then selectively “disabling comments”
  2. “Disabling comments” in a space by default and then selectively “enabling comments”

Either way works, but different people have different needs. Choose whichever is appropriate.

This article requires a couple of user macros

Hide Comments

## User Macro hide-comments
## Usage: {hide-comments}
<style type="text/css">#com-atlassian-confluence #comments-section { display:none; } </style>

Show Comments

## User Macro : show-comments
## Usage: {show-comments}
<style type="text/css">#com-atlassian-confluence #comments-section { display:block; }</style>

Enabling comments in a space and then selectively “disabling comments”

Simply add {hide-comments} to a page et voila – no commenting functionality is displayed

“Disabling comments” in a space by default and then selectively “enabling comments”

Edit the custom space stylesheet. Add this:

/* hide comments by default */
#com-atlassian-confluence #comments-section { display:none; }

On each page that you want to allow comments, add {show-comments}. This overrides the CSS for div#comments-section allowing the commenting functionality to be displayed.

For extra points

If you’re using the Documentation theme, you can include a common footer to drive comments to a single page within the space, e.g.

Add the following to the footer

[Add a comment|Comments]

Create a Comments page where your comments will all be amassed

On the comments page, add the user macro


That’s it. With a sprinkling of CSS and some very simple user macros, we can effectively turn commenting on and off at will in a more granular manner.

David is a senior developer and solutions architect at AppFusions based in Nottingham, England.

AppFusions solves mixed-technology integration problems. We bring engineering and business workflows together, you can work better, faster and smoother.

AppFusions is headquartered in San Francisco, California and works with enterprise vendors and partners such as IBM, Jive, Egnyte, DropBox, Box and Atlassian.

  • Pingback: Atlassian Confluence()

  • Pingback: F. Nonnenmacher()

  • Steve Smith

    THANK YOU very much for this very straightforward implementation. Works great, very simple. Not sure why this isn’t in the core Confluence implementation. Again, thanks.

    • David

      @Steve: You’re welcome. Glad it’s helpful.

  • Jeremy Swan

    Thanks for sharing! This worked great.

  • @dvdsmpsn

    “@jeremyswan: Thanks for this helpful workaround! More flexible commenting in Atlassian Confluence” you’re welcome :)

  • Gregg K

    Nice article.

    Is there a way to make certain comments visible only to certain groups? For example, internal employee comments visible only to those in the employee group?

    • David Simpson

      Hi Gregg,

      It’s certainly very possible, but you’re looking at a custom plugin or edited theme for that.

      This is the kind of thing we’d consider as an enhancement to AppFusions’ Private Parts for Confluence add-on:

  • Gregg K

    Thanks for the quick response! We’ll…uh…definitely look into PParts.

  • @pevsa

    Dear David,
    the macros are working fine. Now, the comment on all pages has been suppressed, but I have to allow it on the attlassian blog environment and could’n find the right page to place the {show-comments}.

    • David Simpson

      I’m not sure what you mean here. Could you explain a little more.

  • Mel

    What I really want to be able to do is lock the editing of a page but allow comments. Is that even possible?