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
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:Thus, your meta elements do not have a link to the library to determine their values. The following syntax may help for your markup:
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:
To:
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:
og:
tags.example.com
, checkexample.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 classicog:
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.
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.