Priorizing Opengraph Entries

#54394
  • Resolved Mark
    Rank Math free

    Hi,

    apart from Rank Math, I sometimes (if the blog entry contains a video) get the og:image entry from another plugin. It seems like the og:image provided by Rank Math does get priorized. Is there a way to check, if there is already an og:image and if so, not showing the default image by Rank Math?

    Mark

Viewing 1 replies (of 1 total)
  • Alberto
    Rank Math business

    Hello,

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

    Rank Math doesn’t have a function like that but you could use some custom PHP filter to disable Rank Math OpenGraph data in specific posts. You could achieve it by customizing the following code to your needs:

    /**
     * Hook to remove og:tags in specific situations
     */
    add_action( 'rank_math/head', function() {
            if(/*Here goes the condition you want*/){
    	   remove_all_actions( 'rank_math/opengraph/facebook' );
    	   remove_all_actions( 'rank_math/opengraph/twitter' );
            }
    });

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘Priorizing Opengraph Entries’ is closed to new replies.