Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tag a photo to be used as a thumbnail when a page is linked to on Facebook

When a person posts a link on Facebook, Facebook automatically finds a photo to be used as a thumbnail that shows up in the news feed. Is there some sort of (HTML) markup to surround a photo you'd like to use as the first choice?

like image 511
user94154 Avatar asked Nov 27 '09 22:11

user94154


People also ask

How do I share a link with a thumbnail?

Select the desired image, add any further information you want to include in your post, then click the "Post" button to share the link using the new thumbnail.


2 Answers

What you want are the <meta> tags that Facebook defines in their documentation on Facebook_Share/Specifying_Meta_Tags.

You don't put the metadata around the image itself, rather, you put it in the head of the document, like this:

<meta name="title" content="The Title Of The Link" />
<meta name="description" content="A description of the link would go here." /> 
<link rel="image_src" href="http://www.example.com/images/image.jpg" />
like image 85
artlung Avatar answered Oct 14 '22 14:10

artlung


The accepted answer is now out of date. The new way to do it is with an open graph tag e.g.

<meta property="og:image" content="http://example.com/picture.jpg" />
like image 42
jackocnr Avatar answered Oct 14 '22 12:10

jackocnr