Hello,
Thank you for contacting us and sorry for any inconvenience that might have been caused due to that.
The error means that you do not have reviews or ratings from buyers/customers for your products.
The reviews are picked up from the actual WooCommerce product reviews that your buyers/customers leave on your products, and the warning will be cleared after there is a review. Here’s a link for more information:
https://rankmath.com/kb/aggregate-rating-error/#woocommerce
If you don’t have any reviews yet, there will be a warning in the Schema testing tool. That’s because Google will actually look out for those fields. Hence we recommend you spend some time asking happy customers to leave a review/rating to get rid of the “aggregateRating” and “review” warnings.
It is important to note that Google expects at least one of these properties to be present for a valid Product schema.
We hope this helps. Please let us know if you have further questions or concerns.
Thank you.
Hello, thanks for the reply
i used this filter on my functions.php of my theme (Hello Elementor Child)
add_filter(‘rank_math/snippet/rich_snippet_WoocommerceProduct_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;
});
But it doesnt work. Is the above code correct?
Hello,
If you’re using the default Woocommerce Product
schema, you don’t need any filter to integrate the Woocommerce review data into the schema structure, it’ll all be automatic.
Can you please share some example product URLs here that have this error so we can check it from our end?
Looking forward to helping you.