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.

    ​​​​​​​

Viewing 1 replies (of 1 total)

You must be logged in to reply to this ticket.