Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[seo-magic] LinkedIn ignores og:image generated by SEO Magic #422

Open
matt-j-m opened this issue Mar 8, 2024 · 5 comments
Open

[seo-magic] LinkedIn ignores og:image generated by SEO Magic #422

matt-j-m opened this issue Mar 8, 2024 · 5 comments
Assignees
Labels
seo-magic SEO Magic plugin

Comments

@matt-j-m
Copy link

matt-j-m commented Mar 8, 2024

As per title LinkedIn ignores the og:image property generated by SEO Magic and instead falls back to an alternate image found within the page. Using the LinkedIn Post Inspector https://www.linkedin.com/post-inspector shows the image selected, and interestingly says the way to change it is to "Provide a metadata tag for the og:image in the page's head section.", which is already present.

I was able to work around this on a page-by-page basis by setting the SEO Magic Meta Image value to "No image", then entering a custom Metadata entry on the Options tab in the page editor. The main difference in the resulting html is that my custom entry has a filename extension (.jpg) whereas the one generated by the plugin does not. It should be noted that the seomagic-image URL successfully resolved when opened in a separate browser window, before I removed it.

Generated by SEO Magic, ignored by LinkedIn:
<meta property="og:image" content="https://www.simprogroup.com/seomagic-image" />

Custom Metadata value, respected by LinkedIn:
<meta property="og:image" content="https://www.simprogroup.com/user/themes/simpro/images/simpro-generic-preview.jpg" />

Edit: Here is an example which I've not yet applied the work-around to -

Page URL: https://www.simprogroup.com/features/improve-cashflow
SEO Magic generated https://www.simprogroup.com/features/improve-cashflow/seomagic-image shows company logo
LinkedIn Post Inspector picks up a random icon as the preview image: https://www.linkedin.com/post-inspector/inspect/https:%2F%2Fwww.simprogroup.com%2Ffeatures%2Fimprove-cashflow

@matt-j-m matt-j-m added the seo-magic SEO Magic plugin label Mar 8, 2024
@rhukster
Copy link
Member

rhukster commented Mar 8, 2024

It appears that linkedin doesn't like the image proxy not containing the extension of the file. That's unfortunate as really the file extension should be 100% optional as long as the mime type is set correctly (which it is).

I will look into the feasbility of appending the image file's extension to the image proxy URL..

BTW, the image proxy is required as there are some complex rules for possible image locations, and having a single proxy URL and then actually 'streaming' the image via that proxy-url is the best way to handle this.

@rhukster
Copy link
Member

rhukster commented Mar 8, 2024

Should be fixed in next release (v5.2.1)

@matt-j-m
Copy link
Author

matt-j-m commented Mar 12, 2024

Great, thanks @rhukster. I've just updated and can see the file extension is now added. My original issue with LinkedIn is now solved!

However I've just found something else - the og:image for the homepage is now producing a 500 error. It works fine for other pages. In my local environment html it appears as <meta property="og:image" content="http://localhost/seomagic-image.jpg" />.

The error produced begins with

[2024-03-12 13:29:14] grav.CRITICAL: Call to a member function media() on null

Thanks again

@rhukster
Copy link
Member

hmmm... ok sorry about that, will investigate

@rhukster
Copy link
Member

Did some quick testing and I can't replicate this 500 error on my local.. using https://sandbox.local/seomagic-image.jpg

Can you please look in your logs/grav.log and paste me the entire strack trace of that "call to undefined function media()..." error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
seo-magic SEO Magic plugin
Projects
None yet
Development

No branches or pull requests

2 participants