aggregate rating and review are missing

#545136
  • Resolved Arien
    Rank Math free

    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.

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

    Thank you for contacting the support and sorry for any inconvenience that might have been caused due to that.

    post_meta gives all the values of the particular post. Every plugin saves it’s meta inputs with the “post_id” in the _postmeta table within the database. Yopto if they save the user reviews in the database, you can get their post meta field name.

    I would suggest please connect with Yopto support and ask how are they saving the reviews in the database and what should be replaced there.

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

    Thank you

    Arien
    Rank Math free

    Thank you for your explanation.

    In Yotpo documentation I found out that I have to install following code (2nd paragraph) for aggregate rating on singleproduct page:

    <!– Begin product scope, all of the markup has to be within this scope. –>
    <div itemscope itemtype=”http://schema.org/Product”&gt;
    <span itemprop=”brand”>Your Brand</span>
    <span itemprop=”name”>Your Product name</span>
    Your product logo
    <span itemprop=”description”>Your product description goes here</span>

    <!– Pull the RatingValue and ReviewCount from the Yotpo API and cache and embed it in the markup, the text has to be visible and in your product scope–>
    <span itemprop=”aggregateRating” itemscope itemtype=”http://schema.org/AggregateRating”&gt;
    <span itemprop=”ratingValue”>4.3</span> stars, based on <span itemprop=”reviewCount”>89
    </span> reviews </span>
    <!– end of aggregate rating –>

    1) first question is where can I find the file for the single product page?

    2) Or alternative option: do I go for the Rankmath option to install the snippet. If yes, can you find the right postId in the above code?

    3) or do I have to install Rankmath snippet and the Yotpo code?

    4) or am I missing the point and is there another way?

    Additional info from yotpo to pull the reviews:
    https://www.dropbox.com/s/7oywxcpu5p35ngs/Schermafbeelding%202023-03-18%20om%2010.59.46.png?dl=0

    Hopefully you can help me a step further because I find it very complicated.

    Thanks, Arien

    Hello,

    That type of schema implementation uses microdata and Rank Math is currently using JSON-LD.

    As for your questions:

    #1 & #2: The location of the file depends on your theme structure. I would suggest checking this one first with your theme author.

    In addition to that, the code you shared is meant for static implementation. The Yotpo documentation provides automation via JSON-LD but it is currently meant for Shopify.

    I would suggest sticking with using our filter and seeking assistance from Yotpo team to properly add the correct configuration.

    #3: The microdata code you shared doesn’t work together with our filter code.

    #4: I would suggest using the filter code we shared and asking the Yotpo team to complete it by replacing the correct meta ID.

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

    Arien
    Rank Math free

    Thank you very much for your detailed explanation. I will try to get the info from Yotpo.

    Hello,

    We are glad that we could address your concern.

    Please do not hesitate to let us know if you need our assistance with anything else.

    Thank 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.

Viewing 5 replies - 1 through 5 (of 5 total)

The ticket ‘aggregate rating and review are missing’ is closed to new replies.