Review has multiple aggregate ratings

#896155
  • Hello Rank Math Support Team,

    I hope you’re doing well.

    I’m encountering an issue where Google Search Console is reporting the following error: “Review has multiple aggregate ratings.” I am using the Porto theme, Rank Math Pro, and Judge.me for reviews.

    I noticed that there is custom code in my functions.php file (under my child theme) that seems to be pulling review data from Judge.me into the Rank Math JSON-LD structured data. However, I’m not sure who added this code—it wasn’t me—and it appears to be causing a conflict with Rank Math’s schema, leading to the duplicate aggregate rating error.

    Here is the code currently in my functions.php file:

    php
    Copy code
    add_filter(‘rank_math/json_ld’, function($data, $jsonld) {
    if (isset($data[‘richSnippet’][‘@type’]) && $data[‘richSnippet’][‘@type’] === ‘Product’) {
    $product_id = get_the_ID();
    $reviews = get_reviews_for_product($product_id);

    if (!empty($reviews)) {
    $review_data = [];
    foreach ($reviews as $review) {
    $review_data[] = [
    ‘@type’ => ‘Review’,
    ‘reviewRating’ => [
    ‘@type’ => ‘Rating’,
    ‘bestRating’ => ‘5’,
    ‘ratingValue’ => $review[‘rating’],
    ‘worstRating’ => ‘1’,
    ],
    ‘author’ => [
    ‘@type’ => ‘Person’,
    ‘name’ => $review[‘author’],
    ],
    ‘reviewBody’ => $review[‘body’],
    ‘datePublished’ => $review[‘date’],
    ];
    }
    $data[‘richSnippet’][‘review’] = $review_data;
    }
    }

    return $data;
    }, 99, 2);
    I believe this is causing a conflict with Rank Math’s handling of the aggregateRating schema and is resulting in the Google Search Console error.

    Could you please advise on how to resolve this? Should this code be removed or adjusted, or is there another way to ensure that reviews from Judge.me integrate correctly with Rank Math without causing duplicate ratings in the structured data?

    I’ve attached a screenshot of the error from Google Search Console for your reference.
    https://imgur.com/a/KGSTOxV

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    You mentioned that you’re using Rank Math PRO but the account you have used to open this ticket is the Rank Math free version.

    Can you please search and forward a receipt from FastSpring.com or the email address you used to purchase so we can locate your account and verify it?

    Meanwhile, the review schema is generated by the Judge.me plugin, you should get in touch with their development team to fix this issue.

    Here’s a sample filter from Stamped.io which they can modify to pass the data in Rank Math’s Product schema:

    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
    	$stampedDBData = get_post_meta(get_queried_object_id(), 'stamped_io_product_reviews', true);
    	if( is_array($stampedDBData) && isset($stampedDBData['reviewsAverage'], $stampedDBData['reviewsCount'])) {
    			$entity['aggregateRating']['@type'] = "AggregateRating";
    			$entity['aggregateRating']['ratingValue'] = $stampedDBData['reviewsAverage'];
    			$entity['aggregateRating']['ratingCount'] = $stampedDBData['reviewsCount'];
    	}
    	
    	return $entity;
    });

    Looking forward to helping you.

    i am using pro version but it is own by someone else, and i dont have access in his emails. and the code you provided should i replace exist code in function.php file code with your provided code?

    Hello,

    Unless the subscription you are connected to is a Business/Agency subscription; if it is a PRO subscription it shouldn’t be used on third-party sites (only on the personal sites of the subscriber).

    The filter we provided is a sample and is specific to Stamped.io. You can share it with the Judge.me support as it might guide them in creating one you can use.

    Hope that helps, and please do not hesitate to let us know if you need our assistance with anything else.

    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 3 replies - 1 through 3 (of 3 total)

The ticket ‘Review has multiple aggregate ratings’ is closed to new replies.