OpenGraph filters?

#130640
  • Resolved Lucas Williams
    Rank Math free

    I was wondering if there’s a way to hook into the OpenGraph tags, specifically as it relates to the images. I have a site that uses external images for it’s social media images. You have these few meta keys:

    rank_math_facebook_image <= absolute url
    rank_math_facebook_image_id <= attachment id
    rank_math_twitter_image <= absolute url
    rank_math_twitter_image_id <= attachment id

    And I noticed that it priorities the image id field over the image field (doesn’t seem like the image field is used at all).

    Coming from using YoastSEO, there was a filter you could use to hook into the output of the og:image and things similar to that. However, looking at your code and your documentation I don’t see anything similar.

    I noticed that you have this action rank_math/opengraph/facebook which basically calls
    add_action( 'rank_math/opengraph/facebook', ['RankMath\OpenGraph\Facebook', 'image'], 30 )
    but I if I try to remove it or modify it like other types of actions and filters, it doesn’t seem to work either.

    Is there something else I need to be looking into? Andy direction would help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Danial
    Rank Math business

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    Have you gone through our hooks and filters for developers page in our KB?
    Here is the link: https://rankmath.com/kb/filters-hooks-api-developer/#opengraph

    I hope this resolves your issue.

    Lucas Williams
    Rank Math free

    For some reason, I did not see these filters when I searched for them. I feel like an idiot. I’m pretty sure these should work fine.

    Thanks for the quick response.

    Lucas Williams
    Rank Math free

    Just letting you know that these hooks worked perfectly for me and the logic I had from my Yoast hooks seamlessly transitioned.

    Thanks again!

    Hello,

    We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.

    If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.

    If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)

The ticket ‘OpenGraph filters?’ is closed to new replies.