How to remove OG tags?

#354090
  • Resolved Hamza Sheikh
    Rank Math free

    I like to remove the OG tags from my site. I am unable to find any option that allows me to remove them sitewide.

    Is there any possibility I can achieve that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Anas
    Rank Math business

    Hello,

    Thank you for contacting Rank Math.

    You can use the following filter to remove the og tags:

    add_action( 'rank_math/head', function() {
    	remove_all_actions( 'rank_math/opengraph/facebook' );
    });

    Here is a guide you can follow to add the filter:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps.

    Thank you.

    Thanks, Anas for the quick response.

    I have used the code provided by you and as well as this one to remove further remove Twitter OG as well, however, I am still seeing references to Twitter code on my website.

    Can you please take a look and point me in a direction?

    remove_all_actions( 'rank_math/opengraph/twitter' );

    <meta name="twitter:label1" content="Written by" />
    <meta name="twitter:data1" content="admin admin" />
    <meta name="twitter:label2" content="Time to read" />
    <meta name="twitter:data2" content="Less than a minute" />

    Anas
    Rank Math business

    Hello,

    Please add this in the filter:
    remove_all_actions( 'rank_math/opengraph/slack' );

    Hope that 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 ‘How to remove OG tags?’ is closed to new replies.