Search code examples
htmllinkedin-apifacebook-opengraphsocial-mediasocialshare

Linkedin show 3 different image when sharing


Linkedin show different 3 image when trying to share. Here is then head tags

<meta property="og:site_name" content="OkyTalk">
<meta property="og:title" content="OkyTalk ">
<meta property="og:type" content="website">
<meta property="og:url" content="https://okytalk.com/teachers/profile/displayProffesional">
<meta property="og:image" content="https://okytalk.com/media/okytalk/img/share.jpg">
<meta property="og:image:type" content="image/jpeg">
<meta property="og:image:width" content="470">
<meta property="og:image:height" content="246">

enter image description here

Any Ideas how to show only one ? Others share(facebook, twitter, google+) works fine.


Solution

  • Things certainly have changed since 2015! For instance, the entire company of LinkedIn has been bought by Microsoft, and almost all the old documentation for LinkedIn on LinkedIn.com just 404's. I'm going to post in case others still have this problem.

    To quote from the Microsoft LinkedIn Share Documentation, you want your share URL actually to be...

    https://www.linkedin.com/sharing/share-offsite/?url={url}
    

    Your og: tags appear to be correct, and they should be properly interpreted today, in 2020. It seems that they were only officially supported in 2017, two years after your question. Take a look at the LinkedIn Developer Docs: Making Your Website Shareable on LinkedIn. These should work...

    • <meta property='og:title' content='Title of the article"/>
    • <meta property='og:image' content='//media.example.com/ 1234567.jpg"/>
    • <meta property='og:description' content='Description that will show in the preview"/>
    • <meta property='og:url' content='//www.example.com/URL of the article" />

    Don't forget, once you're all coded and done, you can test your page! Take the URL of your site (example.com, not linkedin.com/share?site=example.com), and input it into the LinkedIn Post Inspector.

    Here's an online demo I created with 20+ share services (100% no monetary income, it is designed as a test site). Take a look at the source code, and see how it's making the LinkedIn URL work with og: tags.

    Hope all this info helps someone!