Yoast SEO
[resolved] [Plugin: WordPress SEO by Yoast] How to specify og:image using filters? (5 posts)

  1. BornKillaz
    Posted 4 years ago #


    Since I'm using a custom premium theme, yoast can't find the images on the content.

    How can I use a filter to strictly specify in my theme the image to use in open graph?



  2. Joost de Valk
    Plugin Author

    Posted 4 years ago #

    Easiest way is to add the og:image tag yourself and hook it on the wpseo_opengraph action.

  3. BornKillaz
    Posted 4 years ago #

    Thank you very much for point me out the best solution. It's working! :)

  4. Joost de Valk
    Plugin Author

    Posted 4 years ago #

    Cool :)

  5. billvf
    Posted 3 years ago #


    I think I'm trying to do the same thing here but would appreciate a more detailed answer if someone is willing to provide it :)

    I am using a theme that uses non-square thumbnails, which I like. However, when I share the post on facebook, it crops my image to a square, sometimes chopping off important parts of the image.

    What I would like to do is add a custom field to my posts where I specify the url of the square version of the thumbnail that I will create. Then I would like to write some code that will use that image in og:image. How can I go about doing that?

    Or is there a better solution to this that I am missing.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic