Search code examples
htmlmetadatasharelinkedin-apifacebook-opengraph

meta property image not working in linkedin


meta property for image working fine in Facebook but not in LinkedIn I'm using

    <meta property="og:image" content='image url' />

I tried

<meta property="og:image:width" content="180" />
<meta property="og:image:height" content="110" />

but still not working in Linkedin


Solution

  • Try the following:

       <meta prefix="og: http://ogp.me/ns#" property="og:title" content="{Your content}" />
        <meta prefix="og: http://ogp.me/ns#" property="og:type" content="{Your content}" />
        <meta prefix="og: http://ogp.me/ns#" property="og:image" content="{Your content}" />
        <meta prefix="og: http://ogp.me/ns#" property="og:url" content="{Your content}" />
    

    Forexample:

    <meta prefix="og: http://ogp.me/ns#" property="og:image" content="http://image.com/myimage.png" />
    

    Or have a look at the code provided by Linkekedin:

    <html prefix="og: http://ogp.me/ns#">
    <head>
      <meta property="og:image" content="http://example.com/foo.jpg" />
    </head>
    <body>
    

    For the highest quality presentation on LinkedIn.com, the image referenced in og:image should be at least 80 x 150px to prevent it from being artificially stretched to fit the layout.