RankMath + JSON-LD Plugin

#5977
  • Resolved Rakesh Prabhu
    Rank Math free

    I have RankMath installed on my WordPress website and find it very useful.

    Additionally, I also want to use WP-SSO alongside RankMath for Google Rich Results (JSON-LD) and Social Search (FB, Twitter, LinkedIN, Pinterest) optimization.

    Could you please advise how I could handoff Google Rich Results (JSON-LD) and Social Search (FB, Twitter, LinkedIN, Pinterest) optimization to WPSSO?.

    Is there any setting in RankMath to avoid adding JSON-LD and Social Open graph data for FB and Twitter.

    Regards,

    Rakesh

Viewing 3 replies - 1 through 3 (of 3 total)
  • Todd
    Rank Math free

    Hi Rakesh,

    Thank you for getting in touch.

    1. Disable the Rich Snippets module from WordPress Dashboard > Rank Math > Dashboard.

    2. Use this to remove OpenGraph + JSON+LD data:

    https://rankmath.com/kb/filters-hooks-api-developer/#remove-opengraph-tags

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hi Todd,

    Thank you for your prompt reply.

    I have added below snippets to functions.php

    Could you please advise if this would suffice?

    /**
    * Hook to remove og:tags
    */
    add_action( ‘rank_math/head’, function() {
    remove_all_actions( ‘rank_math/opengraph/facebook’ );
    remove_all_actions( ‘rank_math/opengraph/twitter’ );
    });

    /**
    * Code to remove json+ld data
    *
    */
    add_action( ‘rank_math/head’, function() {
    global $wp_filter;
    if ( isset( $wp_filter[“rank_math/json_ld”] ) ) {
    unset( $wp_filter[“rank_math/json_ld”] );
    }
    });

    HI there,

    Thanks for the question.

    Yes this should work smoothly, you can also combine the two into one function like so:

    /**
    * Hook to remove og:tags & Json-ld data
    */
    add_action( ‘rank_math/head’, function() {
    global $wp_filter;
    if ( isset( $wp_filter[“rank_math/json_ld”] ) ) {
    unset( $wp_filter[“rank_math/json_ld”] );
    }
    remove_all_actions( ‘rank_math/opengraph/facebook’ );
    remove_all_actions( ‘rank_math/opengraph/twitter’ );
    });

    I hope this info helps. 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 3 replies - 1 through 3 (of 3 total)

The ticket ‘RankMath + JSON-LD Plugin’ is closed to new replies.