Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the share image when clicking the like button

I am setting up a blog and it contains a Facebook "Like" button. With this button you can like a post.

But when I like a post, a popup shows up with a randomly picked image on my website. I've looked into the meta tags for Facebook and I filled all six of them with content, but clicking the Like button still causes that same random image shows up. How can I control this image when I click the Like button?

like image 357
Erik van der Bas Avatar asked Jan 23 '12 14:01

Erik van der Bas


2 Answers

Include the following meta tag in your site:

<meta property="og:image" content="path-to/mylogo.png" />

More info about open graph images can be found here. After changing the image, Facebook needs time to update this information due to caching.

Edit: you can view and reset Facebooks cache with the developer tool debug page

like image 169
Thomas Fellinger Avatar answered Nov 02 '22 12:11

Thomas Fellinger


That is because when you change facebook's og (open graph) tags, you cannot see the change immediately, but only when their scraper refreshes the page. Try putting the url through their debugger. If the image here is the one you set up as shared image, then you just have to wait for facebook cache to refresh :)

like image 44
djtina Avatar answered Nov 02 '22 11:11

djtina