当我的网站在Facebook上分享时,如何防止图像显示为缩略图选项?

问题描述:

当用户在Facebook上共享我的网站时,Facebook可以让他们选择一个缩略图来跟随分享。我想要的唯一图像是我的网站标识,但我不知道最好的方法是完成这个。

When a user shares my site on Facebook, Facebook allows them to select a thumbnail image to go along with the share. I'd like the only image made available to be my site logo, but I'm not sure what the best way to accomplish this is.

所以例如这个应该显示为一个选项:

So for example, this should show up as an option:

<img src="logo.png" />

但是我想要忽略其他图像:

But I'd like other images to be ignored:

<img src="news1.jpg" />
<img src="news2.jpg" />
<img src="footerDetail.jpg" />


嘿,这很简单,你只需要指定并在您的页面中打开图形元标记。

Hey, that's quite easy, you just need to specify and open graph metatag in your page.

对于您,将它简单添加到您的页面HEAD:

For you it would be as simple as adding this to your page HEAD :

<meta property="og:image" content="YOUR_IMAGE_URL"/>

您可以在这里找到开放图表元素的完整参考:http://developers.facebook.com/docs/opengraph/

You can find a complete reference of open graphs metatags here : http://developers.facebook.com/docs/opengraph/

您可以测试是否Facebook在这里找到您的图像:
http://developers.facebook.com/tools/lint

And you can test if facebook find your image correctly here : http://developers.facebook.com/tools/lint

(您需要使用第二个链接进行测试,以便Facebook将刷新其关于您网站的缓存信息。)

(You need to test it using the second link so that facebook will refresh its cached informations about your site).

干杯:)