How to set priority order to Open Graph images for links that are inserted in comments. (Not sharing or wall posts.)

我是研究僧i 提交于 2019-11-28 09:52:25

I have just found out that Facebook will try to display best images (higher resolution) first. For example, if I have 3 meta tags in following order:

<meta content='http://mysite/low-res.jpg' property='og:image'>
<meta content='http://mysite/med-res.jpg' property='og:image'>
<meta content='http://mysite/hi-res.jpg'  property='og:image'>

then the order of displaying on Facebook dialog will be:

hi-res.jpg
med-res.jpg
low-res.jpg

I hope it will help.

Actually, my experience is that the last tag (farthest down in the header) is given preference. On some of my sites I force the default by manually adding an og:image tag just before the tag.

As per the instruction at ogp.me...

Arrays
If a tag can have multiple values, just put multiple versions of the same tag on your page. The first tag (from top to bottom) is given preference during conflicts.

<meta property="og:image" content="http://example.com/rock.jpg" />
<meta property="og:image" content="http://example.com/rock2.jpg" />
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!