Setting Oembed data using Yoast (LinkedIn share image not using og:image)
-
Hi,
I discovered that LinkedIn is not using the og:image that we are setting using Yoast, it is using another image on the page. In the LinkedIn debugger (https://www.linkedin.com/post-inspector/) It says ‘Note: We used the value from the provided oEmbed tag on the page.’ It also then says:
‘How to change the image
Provide a metadata tag for the og:image in the page’s head section. For example:
<meta name=”image” property=”og:image” content=”[Image URL here]”>’Yoast is setting this on our website correctly and is being used by Facebook etc, but LinkedIn isn’t using it.
So i have checked the /wp-json/oembed/1.0/embed?url=example.com&format=xml and the image that is being used by LinkedIn is set this file like so:
<thumbnail_url>https://www.images.com/image-name.jpg</thumbnail_url>In this Yoast article here: https://yoast.com/advanced-technical-seo-social-image-ogimage-tags/ it says the following:
‘Frustratingly, if there’s oembed functionality enabled on a page (as is often the case with WordPress sites), LinkedIn with often retrieve the values from that embed code. Rather than any on-page values.
This took some rather painful debugging. But we were thankfully able to fix the problem in Yoast SEO by also rewriting the oembed values to match the on-page values (or disabling / conditionally routing oembed).’
So my question is, is there functionality in Yoast that is meant to be updating the information being set in the oembed file and it’s broken, or is there something wrong with our particular setup that is breaking this functionality? Is there some manual way of overriding the information being set in the Oembed file using Yoast, or do you have some helpful php function that can set what the Oembed information should be?
I found a plugin here: https://www.sitepoint.com/customizing-wordpress-oembed-content/ that is meant to update the oembed content, but it seems excessive to implement a plugin to change some so simple.
Any help you could provide would be greatly appreciated.
- The topic ‘Setting Oembed data using Yoast (LinkedIn share image not using og:image)’ is closed to new replies.