I want to remove product rich snippets from my all existing products.

  • I have more than a thousand product on my e-commerce site. I want to remove product rich snippets from my all existing products. How to do it instantly or automatically ??

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    You can add the following PHP code on your theme’s functions.php file to remove the product schema from your posts:

    /**
     * Filter to Short-circuit Schema if a 3rd party is interested in generating their own data.
     * Replace $schmea_type with schema name like article, review, etc.
     * @param bool  $value true/false Default false
     * @param array $parts Post Data
     * @param array $data  Schmea Data
     * 
     * @return bool
     */
    add_filter( "rank_math/snippet/rich_snippet_product", function( $value, $parts, $data ) {
    	return true;
    }, 10, 3 );

    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.

Viewing 1 replies (of 1 total)

The ticket ‘I want to remove product rich snippets from my all existing products.’ is closed to new replies.