Hello,
Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for the delay.
Could you please try using this filter to integrate the Stamped.io reviews into your products?
add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
$stampedDBData = get_post_meta(get_queried_object_id(), 'stamped_io_product_reviews_new', true);
if( isset($stampedDBData) ) {
$entity['aggregateRating']['@type'] = "AggregateRating";
$entity['aggregateRating']['ratingValue'] = $stampedDBData['rating'];
$entity['aggregateRating']['ratingCount'] = $stampedDBData['count'];
}
return $entity;
});
The filter should be added to your active theme’s functions.php file. Here’s another way to apply the filter using the rankmath.php file:
https://rankmath.com/kb/filters-hooks-api-developer/#adding-filters-and-hooks-in-rank-math-php
Once done, clear your website’s cache and you can validate the page using Google’s Rich Results test tool.
Let us know how that goes. Looking forward to helping you.
Hello again…code is working now but google search console gives me 2 errors now
The value in the “ratingCount” property must be a positive number
The mandatory values for the best and worst rating are missing from the rating
can you help me?
Hello,
I checked the affected page and it seems the ratingCount is showing a correct value as you can see in my screenshot below:
Please clear your website cache and allow Google to recrawl the page again.
Let us know how that goes. Looking forward to helping 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.