How to get Open Graph image to work in LinkedIn

38 Views Asked by At

I have an Open Graph image and the following code in the <head>

<meta property="og:title" content="<?= $site->title_meta_tag() ?>" />
<meta property="og:image" content="<?= url('assets/images/og-image.png') ?>" />
<meta property="og:description" content="<?= page('home')->description_meta_tag() ?>" />
<meta property="og:url" content="<?= $page->url() ?>" />

It works fine in this test site https://opengraph.dev including in the LinkedIn test preview. And I've followed all the instructions here https://www.linkedin.com/help/linkedin/answer/a521928/making-your-website-shareable-on-linkedin?lang=en-us&intendedLocale=en

But, when I post in LinkedIn with a link to my website, where the Open Graph image should be is just a big grey box.

Where should the Open Graph image live - can I put it inside an 'assets' folder, inside an 'images' folder?

0

There are 0 best solutions below