Which image shows up when a link is "attached" on Linkedin?
Asked Answered
L

3

22

When I try to share a "discussion" (which is merely a link from our website) at linkedin through the "Attach a link", it used to pull a nice image earlier, but it ceased to do so now.

Is there a meta property="og: we should specifically use for linkedin shares to have an image shown?

Liqueur answered 17/7, 2012 at 9:53 Comment(0)
F
26

The LinkedIn share functionality supports a small subset of open graph tags as documented here: https://developer.linkedin.com/documents/setting-display-tags-shares

Note that at least until recently (and possibly still) re-scraping of existing shared pages is broken, so if you've already shared a page and it got the wrong image you're stuck unless you share it with a different URL.

Factory answered 18/7, 2012 at 16:51 Comment(6)
Thanks @Kirsten , This should be the accepted answer , although the OGP is evidently there for FB , it's not mentioned on LinkedIn.Buine
I still don't know of a way to 'rescrape' a URL, but you can declare attributes manually using the javascript sdk. See my comment for linksJudgment
The above link no longer appears to go to the appropriate content. I believe this link gets you something close... linkedin.com/help/linkedin/answer/46687/…Odetteodeum
You're right @Odetteodeum !! I was very confused when I arrived at the link in the answer.Heatstroke
Also FYI: see developer.linkedin.com/docs/share-on-linkedin#! on the tab headed "Customized URL" in the section headed "Improve content sharing with Open Graph".Restrict
Apparently re-scraping is still broken in 2017: https://mcmap.net/q/506697/-how-to-clear-linkedin-share-cacheFulgurate
F
10

Add these meta to your webpage head tag.

<meta property='og:title' content='title'/>
<meta property='og:image' content='image/path'/>
<meta property='og:description' content='description'/>
<meta property='og:url' content='your url'/>

While posting on the Linkedin, there is a linkedin cache so if you are going to re-post the same url again, probably the meta will not be picked up. To fix that you can add a parameter at the end of the url while posting on linkedin

e.g original url www.example.com then you can repost this with www.example.com?1

Frith answered 1/2, 2018 at 20:33 Comment(1)
Upvote - the meta properties and new link creation with dummy arguments are helpful. more information is added in the answer above.Vane
J
2

LinkedIn posts can also be designed from scratch using the jssdk. I created a tool that allows me to select what image is displayed, and what caption gets set, when I share a link.

If you want to develop your own, fork my repo:

https://github.com/kaburkett/LinkedIn-Advanced-Share

Judgment answered 18/2, 2016 at 17:45 Comment(1)
@UfukHacıoğulları I pushed a fix for the bug: github.com/kaburkett/LinkedIn-Advanced-Share/issues/1 If you've visited the website before, please revisit now that the issue is fixed, clear your cache (cntrl+f5) and try againJudgment

© 2022 - 2024 — McMap. All rights reserved.