2

For some reason, when I share a URL to my blog post on LinkedIn, the image specified in the og:image tag does not appear in the share LinkedIn post.

URL shared: https://robertcooper.me/post/feature-flags

og:image meta tag found in the page's head:

<meta property="og:image" content="https://www.robertcooper.me/api/og-image/Building%20with%20feature%20flags?readTime=6">

The LinkedIn post inspector confirms that the image won't show up when shared: https://www.linkedin.com/post-inspector/inspect/https:%2F%2Frobertcooper.me%2Fpost%2Ffeature-flags

enter image description here


Testing things out on other websites, I looked at how sharing this URL looks like: https://css-tricks.com/

This shows up correctly on LinkedIn (as confirmed by the LinkedIn post inspector: https://www.linkedin.com/post-inspector/inspect/https:%2F%2Fcss-tricks.com%2F).

enter image description here

2

Your image request is actually returning a 308 response, directing to:

https://robertcooper.me:443/api/og-image/Building with feature flags?readTime=6

Note the addition of the port and the %20 s being returned to spaces.

Also, I seem to recall in the past that LinkedIn got upset if the og:image path didn't look like a file (e.g. ending in .jpg or .png).

1
  • Thanks a lot! The issue was both a redirect issue (www -> non www) and missing .png at the end of the URL. – Robert Cooper May 28 at 4:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.