Searching for a plugin which should count Number of likes and comments

I'm looking for a plug-in whcih should count number of likes and comments added in each page.

Preferably I'm looking for a free plug-in.

Thanks in advance

Vijay Krishna

2 answers

Hey Vijay,

I made a research on our marketplace and over the internet but I did not found a plugin that fully matched the criterea you want.

The onyl plugin I found was the Global Usage Activity which is bundled in confluence and it's disabled by default.

The pros of Above plugin:

  • It shows all the likes of the most popular spaces (not pages).
  • It's free

The Cons:

  • Will only count the likes after the plugin is activated.
  • I'ts know to cause performance problems on long term use on large instances.

Another option I found to achieve the end you want is trough SQL queries in your database:

Number of likes per Page:

select count (*) as Likes, CONTENTID as PageID 
from LIKES
group by CONTENTID;

Number of Comments per Page

select count (*) as Comments, CONTENTID as PageID 
and CONTENT_STATUS = 'current'
group by CONTENTID;

The above you return the page ID which you can use in the end of below URL so you can navigate

to the target page (replace 12345 with the PAGE ID of above querries):


It's not a optimal solution but at least you will be able to know which pages have the most number of likes and comments.
Hope it helps.
Thanks and Regards,
David|Confluence Support Engineer

Servus Vijay,

try this in a UserMacro

## @param Content:title=Content|type=confluence-content|required=true|desc=Select a page
#set($containerManagerClass = $content.class.forName('com.atlassian.spring.container.ContainerManager'))
#set($getInstanceMethod     = $containerManagerClass.getDeclaredMethod('getInstance',null))
#set($containerManager      = $getInstanceMethod.invoke(null,null))
#set($containerContext      = $containerManager.containerContext)
#set($pageManager           = $containerContext.getComponent('pageManager')) 
#set($likeManager           = $containerContext.getComponent('likeManager'))

		#set($parts = $paramContent.split(":"))
		#set($spaceKey = "")
		#set($pageTitle = "")
		#set($valueCount = 0)

		#foreach($part in $parts)	
			#if($valueCount == 0)

		#if($valueCount <= 1)
			#set($spaceKey=$space.getKey() )		

		#set($page = $pageManager.getPage($spaceKey,$pageTitle))

#set($likes = $likeManager.getLikes($page).size() )
#set($comments = $page.getComments().size() )

LIKES: $likes<br>
COMMENTS: $comments<br>

Hope that helps


Thanks Wolfgang,

It's working but I want to have the likes and comments count in each page of a space.

Is there any poosibility like If i give the apce name.It should print all the count of likes,comments in each page of that space.



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Dec 18, 2018 in Confluence Cloud

Happy holidays from our team to yours!

Hi Community!  2018 was filled with changes for our team, both big and small, and we've taken a lot of time to both celebrate our wins and recognize areas of improvement. One thing that we're a...

462 views 3 18
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