How to successfully implement og:image for the LinkedIn

前端 未结 13 2679
陌清茗
陌清茗 2020-12-25 10:36

THE PROBLEM:

  • I am trying, without much success, to implement open graph image on site: http://www.guarenty-group.com/cz/
  • The homepage
相关标签:
13条回答
  • 2020-12-25 10:45

    For me solution was to put all the <meta> tags (without prefix) inside <head> tag.

    For other social networks like Facebook, Twitter or Google you don't even need to have <head> tag. (because it it optional in HTML5 specs)

    PS. There is a new nice way for testing <meta> tags on your website: https://metatags.io/

    0 讨论(0)
  • 2020-12-25 10:49

    LinkedIn is also caching previews. If OpenGraph image was incorrectly cached at some point before, try defeating the cache with a query parameter on a shared link, e.g. https://your-website.com/?1.

    0 讨论(0)
  • 2020-12-25 10:51

    This answer I found on LinkedIn forums might be of help to you:

    Guys, I've spent a whole day trying different things. What worked for me is using the mata [sic] tags as following:

    <meta prefix="og: http://ogp.me/ns#" property="og:title" content="{Your content}" />
    <meta prefix="og: http://ogp.me/ns#" property="og:type" content="{Your content}" />
    <meta prefix="og: http://ogp.me/ns#" property="og:image" content="{Your content}" />
    <meta prefix="og: http://ogp.me/ns#" property="og:url" content="{Your content}" />
    

    Just try to add prefix to every tag (not to html tag), then re-sign in with your LI account to clear the cache... Post your results.

    0 讨论(0)
  • 2020-12-25 10:52

    If @Kym's answer works for you, and you don't want to have a fake URL parameter in your LinkedIn links, a simple solution is just to sign out and then sign back in.

    *Writing my own answer since I don't have enough rep to comment on theirs

    0 讨论(0)
  • 2020-12-25 10:53

    I was having the same issue last night. Spent hours researching solutions and I tried the solutions recommended by others in this post 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/

    0 讨论(0)
  • 2020-12-25 10:56

    I spent whole day implementing it. My main criteria was to do it for all my posts without touching even a single post in Wordpress.

    LinkedIn solution didn't work. Also LinkedIn caches the images for 7 days and if you changed the image, you are not able to look at refreshed image. So these were the constraints and I was able to implement it using some PHP, Javascript and using dummy parameter to refresh LinkedIn cache. Here's the solution

    0 讨论(0)
提交回复
热议问题