Hiding Comments in Confluence

Is it possible to hide comments to annoymous users in confluence.

We dont want users who are not logged in to see any comments on any pages.

4 answers

1 accepted

4 votes
David Simpson Community Champion Nov 06, 2012

You'll need to edit comments.vmd (& perhaps comments.soy) to remove commenting from anonymous users.

Try searching <confluence-install>/confluence/decorators/components/comments.vmd for

#if (!$action.isPrintableVersion())
#requireResourcesForContext("atl.comments")
&lt;div id="comments-section" class="pageSection group"&gt;

Replace with

#if (!$action.isPrintableVersion() &amp;&amp; $!remoteUser)
#requireResourcesForContext("atl.comments")
&lt;div id="comments-section" class="pageSection group"&gt;

I've added && $!remoteUser to the if statement above.

One more thing: You'll have to update this each time you upgrade Confluence. And it's not strictly supported :)

This is brilliant, you are awesome!!

David Simpson Community Champion Nov 08, 2012

Thanks @Brian Mitchell. I always aim for awesome ;)

Hi Brian,

I'm sorry to say that it isn't currently possible to do this using a vanilla install of Confluence but we do have a feature request to ask that we incorporate this kind of fucntionality in a future release of Confluence so I would suggest that you watch/vote/comment on the issue so that our developers are aware of the desire for this functionality.

However, I believe that you might be able to work something out for this using the Customware Visibility plugin and the Hide-From macro to hide page comments from the anonymous user.

All the best,
John

Would this macro need to placed in every page? as the space we are trying to hide comments from is a help system and is extremly vast.

Would it be possible for some instruction or example on how to apply this macro, i have been having trouble for the past few hours to get the syntax correct.

See https://jira.atlassian.com/browse/CONF-7742- Closed, looks like complex Comment Security logic won't be added to the core product.

See https://jira.atlassian.com/browse/CONF-5639- Open when I wrote this, for a slighly simpler proposal for extra comment security

See https://confluence.atlassian.com/display/CONF35/Viewing+Commentsfor information on how to configure how comments behave on a site. Might not be able to 'hide' them, but I think you can have them collapsed when viewed for the first time.

You can use Talk - Advanced Inline Comments add-on. It provides the capability to set vieweing permissions, on a space level and for specific comments. So with Talk you can hide comments and discussions for anonymous users.

Hope it helps.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

373 views 20 10
Join discussion

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