tags:

views:

50

answers:

2

hi all, just curious when you post a link to facebook they seem to parse out some images and some text regarding that link. Does anyone have a guess as to how they determine what text and images to show?

+2  A: 

If the page you are posting a link to has a description meta tag they use that for the text.

As to the image, there's a little control that appears after you paste a link and before you publish it that lets you choose the image (among the images that they found on the page) to appear.

Emanuil
+1  A: 

It uses the head title for the title, meta description for description, and pulls any images (excluding background images) that are no more than 3:1 in proportion, allowing the poster to choose. Developers of the page in question can specify a single image to use on a per-page basis by using a tag as such:

<link rel="image_src" href="/your/image/file" />

(If this image declaration is used, it overrides the selection of other images on the page)

Also, with the recent adoption of the Open Graph Protocol, developers can now define the title, description, and associated image a different way:

<meta property="og:title" content="Page Title" />
<meta property="og:description" content="Page Description" />
<meta property="og:image" content="/path/to/image" />

Personally, I've found the latter to be helpful in case you want search engines to use one page title (the head title) and Facebook to use a different one (Open Graph title).

Andrew

related questions