Hello,
Thank you for contacting Rank Math today.
This setting is not available from the plugin UI but you can modify and add the following code to your theme’s functions.php
file to remove the OG tags:
/**
* 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' );
});
Looking forward to helping you. Thank you.
Hook will disable tags on all pages? I only need on Woocommerce product pages
Hello,
Thanks for contacting us.
You can use the code given below to remove the og:tags only from the products:
/**
* Hook to remove og:tags
*/
add_action( 'rank_math/head', function() {
if(is_product()) {
remove_all_actions( 'rank_math/opengraph/facebook' );
remove_all_actions( 'rank_math/opengraph/twitter' );
}
});
Hope this helps. Let us know if you need any further assistance.
Hello,
We are super happy that we could address your concern. If you have any other questions in the future, know that we are here to help you.
If you don’t mind us asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.