How to insert a facebook like button in a confluence page?

I am trying to add facebok like putton to my confluence page.

Facebook developers gives the code:

I tried to add html using html-include macro, but it doesn't work :S

I want to add social links like atlassian blog does.

How can I do this? Please help.

Thanks for answers.

2 answers

~~~ spam ~~~

2 votes
David Simpson Community Champion Sep 02, 2012

See this reference:

Adapting the HTML5 version of the generated code...

Browse to Confluence Admin | Look & Feel | Custom HTML

In At the end of HEAD, paste:

	var fbLike = '<div class="fb-like" data-href="' + window.location.href + '" data-send="false" data-width="450" data-show-faces="true"></div>';	
	var fbScript = '<div id="fb-root"></div><script>(function(d, s, id) {  var js, fjs = d.getElementsByTagName(s)[0];  if (d.getElementById(id)) return;  js = d.createElement(s); = id;  js.src = "//";  fjs.parentNode.insertBefore(js, fjs); }(document, \'script\', \'facebook-jssdk\'));</' + 'script>';

You should now be able to like and also post to FB:

This inserts to header, but I want to add wherever I want to use it.

David Simpson Community Champion Sep 03, 2012

Yes, that looks kinda weird. I've made a minor edit to the script and it's working good for me on Confluence 4.2 using Google Chrome and Safari on a OSX Lion.

This approach may be better than the answer by @Bahar Çağlar because it automatically will embed the like button on all Confluence pages/blogposts.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

1,131 views 61 8
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