Hello,
Thank you for contacting Rank Math today.
Yes you can disable the OG tags for a certain post type by using the following code snippet:
/**
* Hook to remove og:tags for sepcific post type
*/
add_action( 'rank_math/head', function() {
//replace post_type_name with the name of the post type
if(is_singular('post_type_name')){
remove_all_actions( 'rank_math/opengraph/facebook' );
remove_all_actions( 'rank_math/opengraph/twitter' );
}
});
It is also possible to remove all the Rank Math output for the post type by using the following snippet:
/*
*
* Disable Rank Math for non WP pages
*
*/
add_action( 'wp_head', 'rankmath_disable_features',1);
function rankmath_disable_features() {
if(is_singular('post_type_name')) {
remove_all_actions( 'rank_math/head');
}
}
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.