1

I am implementing the post sharing on linkedin and I want to url og:image to be appear on linkedin when the post is shared. But even I have added the correct url to og:image meta tag. It is not appearing in the share dialogue neither on the linkedin after sharing the post.

This is the url I am using to share my post on linkedin:

https://www.linkedin.com/shareArticle?mini=true&url=http://my_website.com:9000/post/40420&title=Test&summary=Description&source=MyWebsite
Randhir Singh
  • 245
  • 1
  • 7
  • 19
  • I had the same issue. It seems that they cache the image url. Append a dummy string to your url `(https://www.example.com/your-image.jpg?abc)` and you'll be good to go. – Kaveh Feb 16 '20 at 23:41
  • Same issue here, but I finally realized that they only accept **.jpg** or **.png** extension format. – Edison Pebojot May 02 '21 at 02:03

4 Answers4

5

I was having the same issue last night. Spent hours researching solutions but to no avail. Finally I contacted LinkedIn about this issue and they responded right away. Their development team has implemented a new tool called "Post Inspector", which allows you to optimize content sharing. Literally, in just minutes this actually worked.

All you have to do is type in your URL and they do all the busy work i.e. verifying correct code of properties such as image, author, title, description, publication date etc. Not only do they verify, they also tell you what code to include, what is missing, and how to fix it.

Here is the website to use Post Inspector:

https://www.linkedin.com/post-inspector/

  • I had to remove the media from my profile and add it again to work... even though the og:image was working on Post Inspector. https://stackoverflow.com/questions/41140704/linkedin-sharing-url-do-not-show-ogimage/52511416#52511416 – Akber Iqbal Sep 26 '18 at 06:39
4

LinkedIn has this requirements for sharing (but be careful as the quotes look wrong on the LinkedIn webpage - ' matched with ")

Below are the og: tags that must exist and their correct format:

  • <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" />

Here are the image requirements specific to the LinkedIn sharing module:

  • Max file size: 5 MB
  • Minimum image dimensions: 1200 (w) x 627 (h) pixels
  • Recommended ratio: 1.91:1

You can find more details here: https://www.linkedin.com/help/linkedin/answer/46687/making-your-website-shareable-on-linkedin?lang=en

Community
  • 1
  • 1
Victor Leontyev
  • 8,488
  • 2
  • 16
  • 36
0

It took me 1 hour to figure it out.

Put the image tag right after <head>.

<head>
<meta
    name="image"
    property="og:image"
    content="https://2d-array-rotation.com/static/images/2d_array_rotation.jpg"
>

Sometimes software engineers complicate things.

HoldOffHunger
  • 18,769
  • 10
  • 104
  • 133
Brian Sanchez
  • 832
  • 1
  • 13
  • 11
-2
<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" />
General Grievance
  • 4,555
  • 31
  • 31
  • 45
  • 1
    Note: HTML does not use and does not need or require a closing slash on any tag and never has in any HTML specification. – Rob Feb 11 '21 at 11:33