Hello,
Thank you for contacting Rank Math and bringing your concern to our attention.
Please note that AggregateRating works on selected schema types and we have a guide for that. You can check it here: https://rankmath.com/kb/review-schema/#how-to-add-review-rating-schema-markup-to-your-pages
In that guide, you can see if that can help you decide which schema works the best alongside the Article Schema. Here’s a link for more information about Article schema type:
https://developers.google.com/search/docs/advanced/structured-data/article
I hope that helps.
Thank you.
Thank you so much for your reply,
I have one more question and will be glad if you can help me
How can I create “reviewRatings” under “review”
“review”: {
“@type”: “Review”,
“datePublished”: “%date(Y-m-dTH:i:sP)%”,
“dateModified”: “%modified(Y-m-dTH:i:sP)%”,
“author”: {
“@type”: “Person”,
“name”: “%post_author%”
},
“reviewRating”: {
“@type”: “Rating”,
“ratingValue”: “5”,
“worstRating”: “1”,
“bestRating”: “5”
},
}
I tried this but cannot implement reviewRating to Review
add_filter( ‘rank_math/snippet/rich_snippet_product_entity’, function( $entity ) {
$entity[‘review’][‘@type’] = ‘Review’;
$entity[‘reviewRating’][‘@type’] = ‘Rating’;
$entity[‘reviewRating’][‘ratingValue’] = ‘5’;
$entity[‘reviewRating’][‘worstRating’] = ‘1’;
$entity[‘reviewRating’][‘bestRating’] = ‘5’;
return $entity;
});
I got this error
warningreviewRating
The property reviewRating is not recognised by the schema (e.g. schema.org) for an object of type Product.
Thanks
Hello,
Thank you for your patience as we look into why your reviewRating schema is not working.
reviewRating should be inside the review element, for example:
$entity['review']['reviewRating']['@type'] = 'Rating';
Please adjust your code snippet accordingly.
Hope that helps. Please let us know if you have questions.
I couldnt make it work 🙁
$entity[‘review’][‘reviewRating’][‘@type’] = ‘Rating’;
$entity[‘reviewRating’][‘ratingValue’] = ‘5’;
It gives error
Thanks for helping
Hello,
Please try pasting the following code instead:
add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
$entity['review']['@type'] = 'Review';
$entity['review']['reviewRating']['@type'] = 'Rating';
$entity['review']['reviewRating']['ratingValue'] = '5';
$entity['review']['reviewRating']['worstRating'] = '1';
$entity['review']['reviewRating']['bestRating'] = '5';
return $entity;
});
I hope that helps.
Thank you.
Thank you so much, It all well done.
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.