Open graph description meta tag is not working in LinkedIn
Asked Answered
A

4

7

As per this article, LinkedIn is supporting open graph meta tags for link preview. I have added all required meta tags in the head section of my HTML page.

ie.

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <!-- Primary Meta Tags -->
        <title>This is sample title</title>

        <!-- Open Graph / Facebook / LinkedIn -->
        <meta property="og:type" content="website">
        <meta property="og:title" content="This is sample title">
        <meta property="og:description" content='sample description'>
        <meta property="og:image" content="image path">

    </head>
    <body></body>
</html>

But when I share my link on LinkedIn, LinkedIn does not fetch a description in the link preview.

The same link is working fine on Facebook as Facebook also supports open graph meta tags.

Am I missing something?

Is there any type of validation for description?

Anecdote answered 4/10, 2019 at 12:13 Comment(7)
LinkedIn appears to only display the title and the base URL (and the image). That’s what is shown in their Post Inspector (linkedin.com/post-inspector), and that’s what I saw when I scanned down my LinkedIn Feed. The Post Inspector does show the description tag content at the bottom with the other tag data – it’s just not included in the Feed listing. I think LinkedIn leaves it to the person doing the sharing of the URL to write a description of why they’re sharing the URL.Pacer
Share sophos.com It will show description as wellAnecdote
ref: linkedin.com/help/linkedin/forum/question/10013745/…Anecdote
I ran the Sophos and the Alpha10x pages through LinkedIn’s Post inspector. For Alpha10x, it shows the OG image, OG title, and base URL – no description. For Sophos, it shows the page title (Sophos Next Generation Data…) and base URL but no image nor description — that page doesn’t provide an image (nor any OG metatags). I read the LinkedIn Help Form post on descriptions, and while the moderator does say “In most cases” LinkedIn doesn’t pull a description (implying they sometimes do), I scanned through my recent newsfeed and didn’t see any shares with an image, title, AND description.Pacer
In case of sophos link LinkedIn display description ref: ibb.co/D8MkQgVAnecdote
It appears that if you have no Open Graph data (like the Sophos page), then LinkedIn pulls the title and description from the title tag and the description meta tag and post those, along with the base URL (the title appears to be limited to 39 characters and the description to 100 characters). I sent the URL using WhatsApp and it does the same (shows the title and description). I tried it on one of my webpages (deleting the OG info) and LinkedIn showed the description. It's hard to say if no OG meta data is a good solution long term, but it seems to do what you want, so, drop the OG meta tags.Pacer
Maybe it will work without OG meta tags in LinkedIn, but at the same time, it will not work on facebook ;)Anecdote
O
7

Only one of these tags will display...

(list here is with higher-priority items at the top)

  • <meta property='og:image' content='//media.example.com/ 1234567.jpg"/>
  • <meta property='og:description' content='Description that will show in the preview"/>

You CANNOT display image AND description. You can display image, or description, but not both.

Source: LinkedIn Support Ticket #200531-001886.

That is probably your problem.

If you're absolutely uncertain why the LinkedIn preview for sharing your page isn't populating correctly, try each of the following:

  • LinkedIn Post Inspector: Inspect your URL and the inspector will tell you what it found, why it used what content, and how. Added bonus: This should invalidate LinkedIn's cache of your page (though the invalidation happens after the request, so, you'll need to re-request if you want the invalidation results).
  • OpenGraph Checker: Validate your og: tags.
  • Manually Refresh LinkedIn's Cache: Don't check example.com, check example.com?someFakeArgument=Fake, which is a different URL and should trigger a cache miss.

There are many ways to set this data. I have seen the following picked up: standard HTML <head> tags, oEmbed data, API post config (requires appid), and the classic og: tags, as we are dealing with.

You may have any of the following tags....

  • <meta property='og:title' content='Title of the article"/>
  • <meta property='og:url' content='//www.example.com/URL of the article" />

Source: Official Microsoft LinkedIn Documentation.

Orose answered 16/6, 2020 at 18:49 Comment(2)
Thanks, using the post inspector to refresh the cache fixed it for me 👍Shamefaced
Hi, Xander, glad that helped! Feel free to upvote to let others know this answer helped, unless you already have, thanks!Orose
R
2

In your meta elements for all the open graph you specified, you missed the namespace to ogp which is indicated with the use of the prefix element: prefix="og: http://ogp.me/ns#". Check out the example from the Open Graph guide:

<html prefix="og: http://ogp.me/ns#">
<head>
<title>The Rock (1996)</title>
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="video.movie" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />
...
</head>
...
</html>

Thus, your meta elements do not have a link to the library to determine their values. The following syntax may help for your markup:

<!DOCTYPE html prefix="og: http://ogp.me/ns#">
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <!-- Primary Meta Tags -->
        <title>This is sample title</title>

        <!-- Open Graph / Facebook / LinkedIn -->
        <meta property="og:type" content="website">
        <meta property="og:title" content="This is sample title">
        <meta property="og:description" content='sample description'>
        <meta property="og:image" content="image path">

    </head>
    <body></body>
</html>
Rodriquez answered 5/10, 2019 at 5:56 Comment(1)
Tried after adding the prefix, but the same resultAnecdote
A
0

LinkedIn will only show the description if it's at least 100 characters long. When I used a short description, the LinkedIn Post Inspector showed this warning: The description should be at least 100 characters long.

enter image description here

Attitudinize answered 19/1, 2021 at 18:24 Comment(0)
K
-1

I had same problem for my site using property="og:description". I think this issue from the linked in side. So I was updated from open graph description to meta name description and it's working fine for me. Please try with following.

From:

<meta property="og:description" content='sample description'>

To:

<meta name="description" content='sample description'>
Kendo answered 10/2, 2020 at 11:10 Comment(2)
Hey, I tried with the same but not working for me. Can you share your site address so I can have a reference?Anecdote
Have you remove og:description meta tag? Can you please share your site URL?Kendo

© 2022 - 2024 — McMap. All rights reserved.