• Resolved coroleu

    (@coroleu)


    Hi, im showing some custom meta on frontend of my page but your plugin show it your own post meta key and i dont want to show it… i try deleting the plugin but still there. Can i hide that post mete without deactivate the plugin? or just disable the plugin and delete it that meta from the frontend. Thanks
    https://prnt.sc/r4uwa1
    Thanks

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Rank Math SEO

    (@rankmath)

    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.

    Thread Starter coroleu

    (@coroleu)

    Hi, thanks for your answer. On my template page only have this line:
    <?php the_meta(); ?>
    How can i exclude only rank math meta?

    Plugin Author Rank Math SEO

    (@rankmath)

    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.

    Thread Starter coroleu

    (@coroleu)

    Hi,
    Works like a charm.
    Thanks!

    Plugin Author Rank Math SEO

    (@rankmath)

    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://www.ads-software.com/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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hide post meta key’ is closed to new replies.