Question

How can I add a thumbnail when using the facebook.com/sharer.php?u=mysite.com? I've added this to the header: <link rel="image_src" href="http://mysite.com/image.jpg"/>

But: 1. It's not working (yet). 2. It's not valid XHTML.

Is there anyother way or am I doing something wrong?

Thank you.

Was it helpful?

Solution

First, image dimensions matter. It must be at least 50x50 pixels, and images must be up to three times as wide as they are tall.

Second, you can use a meta tag to specify the page image, e.g. <meta property="og:image" content="http://mysite.com/image.jpg"/>

Also notice that Facebook caches pages, so if you want to be sure how Facebook handles your latest version, use their URL Linter.

See information for example here and here and here.

OTHER TIPS

Facebook will get any image on the page, even hidden ones. For example:

<img rel="Facebook image" src="http://mysite.com/image.jpg" />

I've made this work by adding a display:none on any image that you want to include as a thumbnail image, facebook doesn't care what's not displayed, it only looks for tags and uses those as thumbnail options.

This works for when you want the user to select a specific image or any image on the page. Adding the line to the makes the share button only use that one specific image.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top