Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open graph description meta tag is not working in LinkedIn

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?

like image 602
Nitin Avatar asked Oct 04 '19 12:10

Nitin


1 Answers

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.

like image 61
HoldOffHunger Avatar answered Sep 30 '22 20:09

HoldOffHunger