skip to Main Content

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?

4

Answers


  1. 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>
    Login or Signup to reply.
  2. 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'>
    
    Login or Signup to reply.
  3. 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.

    Login or Signup to reply.
  4. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search