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

后端 未结 3 551
花落未央
花落未央 2020-12-10 03:02

When pasting a link to a page within a comment, not directly as a wall post, Facebook defaults to choosing a thumbnail image, without users being able to choose the relevant

相关标签:
3条回答
  • 2020-12-10 03:40

    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.

    0 讨论(0)
  • 2020-12-10 03:41

    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.

    0 讨论(0)
  • 2020-12-10 03:49

    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" />
    
    0 讨论(0)
提交回复
热议问题