display stamped.io ranking in woocomerce schema

#393939
  • Resolved Viktor Somogyvari
    Rank Math free

    Hello,
    I have just switched from yoast and first of I would like to tell im really happy with your product.

    Ive watched some videos, and searched the web but I still did not find the answer for my question.

    so I am using stamped.io to display star ratings on my store, and get reviews instead of the woocomerce/wordpress original review system.

    so I see you can display star rating in google search results with rank maths woocomerce schema, but I would like to display the stamped.io reviews for obvious reasons I have most of the reviews collected there.

    is there a way to do this?

    thank you so much in advance for your kind help.

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

    Thank you for contacting Rank Math and bringing your concern to our attention.

    Please try using this filter to integrate the Stamped.io reviews into your products:

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

    The filter should be added to your active theme’s functions.php file. Here’s another way to apply the filter using the rankmath.php file:
    https://rankmath.com/kb/filters-hooks-api-developer/#adding-filters-and-hooks-in-rank-math-php

    Once done, clear your website’s cache and you can validate the page using Google’s Rich Results test tool.

    I hope that helps.

    Thank you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    hello Reinelle,

    thank you for your kind and fast answer.

    im not very technical, and not good with coding, so maybe its not working the way it should because i added the code you have suggested, to the code snippets plugin.

    https://prnt.sc/3Ra73Cq4cfwT

    https://prnt.sc/z_wNhMUbjBlN

    after this i cleared the cache (using wp rocket)

    than in my wordpress dashboard went to a product with a lot of stampad.io reviews, an copied the code from the schema builder, (using woocomerce product schema)to google rich resoult test tool. but i think its not working.

    https://prnt.sc/sjFtFy5jXHWn

    Am i doing something wrong??

    thank in advance, have agrat day

    Hello,

    The filter adds the aggregateRating in the frontend so checking the code directly will not work. If you check your product URLs, you can see that the AggregateRating property is being added properly to the Schema:

    Please check and let us know if you need any other assistance.

    Thanks.

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

The ticket ‘display stamped.io ranking in woocomerce schema’ is closed to new replies.