How to remove Rich Snippets globally (option not working)

#12515
  • Resolved Tom
    Rank Math free

    Hi when I installed Rank Math I selected “Review” as my default rich snippet. However, right now I want to disable rich snippets until I can optimize each post individually. So I turned this to “None” in the Posts settings.

    However, I still see the snippet text at the end of each post (along with an editor’s rating out of 5 stars). It seems I need to manually turn off rich snippets within the post for it to be removed. Is there something wrong with the global option?

    Thanks,
    Tom

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math today.

    This is expected behavior, the settings already set on individual posts take a high priority than the global options set on the Titles & Meta page.
    You can however workaround this by adding the below code on your functions.php file to remove the review snippet from all your posts:

    /**
     * Rank Math Filter to disable review schema on posts
     * 
     * @param bool  $value true/false Default false
     * @param array $parts Post Data
     * @param array $data Schema Data
     * 
     * @return bool
     */
    add_filter( "rank_math/snippet/rich_snippet_review", function( $value, $parts, $data ) {
    	return true;
    }, 10, 3 );

    Looking forward to helping you. Thank you.

    ​​​​​​

    Tom
    Rank Math free

    Thanks but for posts where I haven’t touched the Rich Snippets option, why doesn’t the global setting affect them? Just seems like a hassle. I don’t think I know how to edit functions.php

    Hi Tom,

    Thanks for the follow up.

    This should not be the case, I have just tested this and it works to change posts that had not been modified. The code should be added at the bottom of your functions.php file. Please share some temporary access and I will be happy to help in adding the necessary code.

    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 Rich Snippets globally (option not working)’ is closed to new replies.