OpenGraph Filters are not working

  • Some of the filters are working but not the few that I need.

    I am able to use….
    add_action( ‘rank_math/head’, function() {
    remove_all_actions( ‘rank_math/opengraph/facebook’ );
    remove_all_actions( ‘rank_math/opengraph/twitter’ );
    });
    add_filter( ‘rank_math/opengraph/url’, function( $url ) {
    return “my url”;
    });

    I am unable to use any of these variations that I tried to update the og:title

    add_filter( “rank_math/opengraph/facebook/og:title”, function( $content ) {
    return ‘my title’;
    });

    add_filter( “rank_math/opengraph/facebook/title”, function( $content ) {
    return ‘my title’;
    });

    add_filter( ‘rank_math/opengraph/title’, function( $content ) {
    return “my title”;
    });

Viewing 1 replies (of 1 total)
  • Hello,

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

    The correct syntax should be the following:

    add_filter( “rank_math/opengraph/facebook/og_title”, function( $content ) {
    return ‘my title’;
    });

    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 ‘OpenGraph Filters are not working’ is closed to new replies.