og:image url for attachment pages
-
Hello, I wanted to notify the dev team about a minor problem I noticed, and ask if there is workaround for it…
When you use attachment pages in a website, and you set Yoast SEO settings so that it does not redirect the attachment page URL to the attachment itself, the OpenGraph image URL meta tag of the attachment page does not get set correctly. This causes problems on sharing the attachment pages on Social Media platforms…
Basically, Yoast SEO sets the “og:image” URL to the attachment page URL, not the image file’s URL.
(I have tried manually assigning the FB share image through the media SEO settings, it still sets “og:image” URL to the attachment page URL.)
I reckon it is a small oversight or perhaps a decision as the Yoast team recommends redirecting attachment URLs to the attachment itself.
But in certain use cases, we prefer using attachment pages.
I hope the dev team can take a look in a later update.
But until then, Is there a way I can change this behavior?
Maybe with a setting I don’t know or maybe via a functions.php injection?
- The topic ‘og:image url for attachment pages’ is closed to new replies.