Hello @coroleu
Thank you for contacting the support.
Can you please tell us how are you showing the Post Metadata on the frontend?
If you are using some function like get_post_meta() then you can exclude the Rank Math data using the strpos function:
if (strpos( $meta_key, 'rank_math_') !== false) {
//Show meta data
}
Hope that helps.
Hi, thanks for your answer. On my template page only have this line:
<?php the_meta(); ?>
How can i exclude only rank math meta?
Hello @coroleu
It seems like an issue in our plugin. We will get it fixed in one of the upcoming updates.
For now, please add the following code in your theme’s functions.php file to fix it:
add_filter( 'is_protected_meta', function( $protected, $meta_key ) {
$key = 'rank_math_';
return substr( $meta_key, 0, strlen( $key ) ) === (string) $key ? true : $protected;
}, 10, 2 );
Hope that helps. Thank you.
Hi,
Works like a charm.
Thanks!
Hello @coroleu
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me 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 do 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.