Linkedin og:image not working

Hey,

A client was having problems with some of his article's images not showing on Linkedin. After a lot of headache investigating this, I found out that the images that were not showing had a longer name. So it turns out that if the URL is longer than 118 characters, Linkedin won't scrape it and show it.

This isn't a problem for Facebook, Twitter, etc.

Is there any way possible to reduce the length of the URL besides changing the name of the file. For example:

https://images.prismic.io/reponame/8ca26978-4086-4d9a-a052-bc3961499ce5_Untitled+design-2.png?auto=compress,format

Hey @kris, thanks for sharing this with us. It is not recommended to modify the URLs of the media files. Especially for images, as they would lose the automatic image compression. We've discussed this in different threads. This one for example:

Can you tell us exactly where you're adding the image URL and what error you're getting? if you could embed a screenshot it'll be really useful.

Hey @kris ,

Can you send me the link where you found the information about the character limit on Linkedin social cards? I'll try and investigate further.

Thanks.

@Phil Sadly, I couldn't find an official documentation - it was mentioned in a comment with 0 upvotes on Stack Overview. So take it with a grain of salt, but I tried it several times (shortening the name of the image file, which shortens the url itself) and it worked.

It wasn't a problem every single time, only sometimes. Probably something that you could explore if you had a spare hour on a Friday afternoon. It's only a problem in Linkedin fyi

OK, I'll look into this further. We are working on the ability to disable imgix per repo which would stop this but you'd lose all the image compression.

I'll talk with the team about the imgix IDs and what our options are.

Thanks.

Hey @kris ,

So I reached out to the team at imgix and they ran some tests.

Here's what they reported back to me:

I'm using this validator to test some URLs:
Post Inspector

So I'm getting it to work on longer images:
https://www.linkedin.com/post-inspector/inspect/https:%2F%2Fimages.prismic.io%2Ftdeco[…]=fill&fill=solid&fillcolor=f7fafc&dpr=1&q=75&ixlib=vue-2.8.1

Let's me make it silly long and try again. So I just tried doing a 306 character long URL:
https://images.prismic.io/tdecomm21/de0680b1-d97e-464b-bc34-0e78a03f1e7c_ix_grey_shirt.png?auto=format&w=580&h=580&fit=fill&fill=solid&fillcolor=f7fafc&dpr=1&q=75&ixlib=vue-2.8.1&blend-size=inherit&blend-mode=multiply&blend=https://demos.imgix.net/dark-ellipse-gradient.ai?fm=png%26w=580%26h=580%26fit=crop

It did work on linkedin:
https://www.linkedin.com/post-inspector/inspect/https:%2F%2Fimages.prismic.io%2Ftdeco[…]llipse-gradient.ai%3Ffm=png%2526w=580%2526h=580%2526fit=crop

Just put it in LinkedIn, it worked here as well. I think it's safe to say that the character limit doesn't exist.
Thomas Dale on LinkedIn: Philip Snow Check out this image I made. Pretty cool. Let's test the

Also, the example URL in the Prismic article is 404 throwing an error on its own
https://images.prismic.io/reponame/8ca26978-4086-4d9a-a052-bc3961499ce5_Untitled+design-2.png?auto=compress,format

So it seems there's no character limit.

Thanks.

Amazing, thanks a lot for investigating this @Phil !

It seems that the majority of cases when it doesn't work is using .png as opposed to .jpeg or .jpg.

1 Like

Since it's a case of linkedin not accepting certain image formats, then luckily with the imgix integration you can dictate what format specific images are output in:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.