-
Hello,
I am using Yotpo for collecting reviews and they display perfectly on my product pages(woocommerce)
However in google search console I get the comments that the fields aggregate rating and review are missing.
I have read your documentation how to implement code to get this working. I intend to do by inserting your suggested code snippet:
add_filter(‘rank_math/snippet/rich_snippet_product_entity’, function ($entity) {
$score = get_post_meta(get_the_ID(), ‘users_rating’, true); // Replace with your rating post meta.
$count = get_post_meta(get_the_ID(), ‘users_rating_count’, true); // Replace with your rating count post meta.
$entity[‘aggregateRating’] = array(
‘@type’ => ‘aggregateRating’,
‘ratingValue’ => $score,
‘ratingCount’ => $count,
);
return $entity;
});However, you give the following comments: “Make sure to replace users_rating and user _rating_count with your post meta.”
Sorry for my ignorance, but what would be the post meta I would have to use. What do you mean by ‘post meta’ in this case?
Many thanks for your reaction.
The ticket ‘aggregate rating and review are missing’ is closed to new replies.