-
Notifications
You must be signed in to change notification settings - Fork 156
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
Apply Social Image settings to oEmbed #3186
Comments
@Kevin-Hamilton I accidentally moved instead of copied your issue to our internal repository so I've reopened it. We're going to investigate this and see what our options are. Filtering the URL is more likely since removing those oEmbed discovery links and scripts may break a lot of other plugins. |
Thanks. I took a peek and it appears the oembed_response_data hook in wp-includes/embed.php would be the place to filter this. Will need to run with priority higher than 10 to override the result of the existing get_oembed_response_data_rich filter. |
@Kevin-Hamilton correct, I was thinking of doing something like this -
Just need to get to it. Do you know when a oEmbed thumbnail URL is output in the source code (is it when you embed a YouTube video for example)? Knowing that, I can get this in one of the next updates significantly faster. |
It looks like the triggers for including the thumbnail_url in the oembed output are: I would think your criteria for setting it would not be limited to when it is already set, like your example code, but rather any post type where you would display an og:image. |
I just tripped over a variant of this issue again, 4 years later! In this case, it was LinkedIn pulling the WordPress page title instead of the custom title that is set in AIOSEO. LinkedIn prioritizes the oEmbed title over both the page html title tag and the meta og:title. Here was my fix:
|
@Kevin-Hamilton commented on Thu Mar 18 2021
Is your feature request related to a problem? Please describe.
LinkedIn gives preference to oEmbed over og:image meta tags. The oEmbed "thumbnail_url" is taken from the featured image on the page rather than any social image setting made in AIOSEO.
Describe the solution you'd like
I would like if the AIOSEO plugin could apply its social image settings to the oEmbed content in WordPress. If that is not possible, then at least an option to disable oEmbed (with appropriate warnings/disclaimers to the user), which would then force LinkedIn to fallback to og meta tags. My current workaround is to remove oEmbed by adding the following to the functions.php which in my testing does appear to get the job done:
Additional context
Related: https://wordpress.org/support/topic/linkedin-showing-wrong-image/
The text was updated successfully, but these errors were encountered: