1
votes

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
4
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
Same issue here, but I finally realized that they only accept .jpg or .png extension format. - Edison Pebojot

4 Answers

4
votes

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/

3
votes

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

0
votes

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.

-2
votes
<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" />