-
Hi RankMath,
Love the plugin! I am working with Stamped.io to integrate our product reviews to our site. You’ll see our product page here https://themoonjoy.com/product/moon-phase-poster-print/ I reached out to Stamped and they shared some code with me to get it working with your plugin but they gave some specific details to be changed. I’ll share this below in the Sensitive Data Portion. Thank you in advance for any help you can provide.
-
Hello,
Thank you for contacting Rank Math today.
Please use the following to get the product id.
add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) { global $post; $entity[ '@id' ] = get_the_permalink( $post ) . '#product'; return $entity; });
Looking forward to helping you. Thank you.
Thank you for the reply. Sorry I am a bit unclear. What all needs to be put into the functions.php in order for the Stamped Plugin to load as well as incorporate Google rich review schema?
Hello,
The code my colleague provided should fix the issue you mentioned. It will add @id to the Product schema generated by the Rank Math plugin and since Stamped is also using the same @id, Google will see this as 1 schema.
After adding the code to the theme’s functions.php file, please check your page in the Google’s Rich Results Testing tool and see if it shows any errors or warnings: https://search.google.com/test/rich-results
I hope that helps.
Hi, Thank you for the reply.
Unfortunately, I am still getting errors after putting both the script prodvided by Stamped in the <head> and the additional piece of code given by your colleague Michael to the functions.php. The errors are here on the google rich results.
Unnamed item
5 warnings2 errors
Missing field “name”
Either “offers”, “review”, or “aggregateRating” should be specified
Missing field “image” (optional)
Missing field “description” (optional)
Missing field “sku” (optional)
Missing field “brand” (optional)
No global identifier provided (e.g., gtin, mpn, isbn) (optional)
type
Product
id
https://store.com/URL/#productHello,
We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WP logins in the designated Sensitive Data section.
It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:
https://wordpress.org/plugins/temporary-login-without-password/
You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):
https://wordpress.org/plugins/wp-security-audit-log/
We really look forward to helping you.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
As far as I know Stamped plugin stores rating data in
stamped_io_product_reviews_new
key. So please try adding the code we provided in the following ticket:
https://support.rankmath.com/ticket/stamped-io-integration/?view=all#post-51492This had fixed the issue for the user and should fix it on your site as well.
I hope that helps.
Hi I’ve tried adding the code from your above link and I am unfortunately getting an error on the } before return $entity;. `add_filter( ‘rank_math/snippet/rich_snippet_product_entity’, function( $entity ) {
$stampedDBData = get_post_meta( $post->ID, ‘stamped_io_product_reviews_new’, true );
if ( ! empty( $stampedDBData[‘rating’] ) ) {
$entity[‘aggregateRating’] = [
‘@type’ => ‘AggregateRating’,
‘ratingValue’ => $stampedDBData[‘rating’],
‘bestRating’ => 5,
‘ratingCount’ => $stampedDBData[‘count’],
‘reviewCount’ => $stampedDBData[‘count’],
]
}
return $entity;
});`Error message after entering suggested above code.
- This reply was modified 4 years, 2 months ago by Jeremy. Reason: link loaded incorrectly
Hello,
Please try this code:
add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) { global $product; $stampedDBData = get_post_meta( $product->get_id(), 'stamped_io_product_reviews_new', true ); if ( $product->is_type( 'variable' )) { $variations = $product->get_available_variations(); foreach ( $variations as $key => $variation ) { $entity['offers'][ $key ]['gtin14'] = get_post_meta( $variation['variation_id'], '_wpm_gtin_code', true ); } } else { $entity['gtin14'] = $product->get_meta( '_wpm_gtin_code' ); $entity['aggregateRating'] = [ '@type' => 'AggregateRating', 'ratingValue' => $stampedDBData['rating'], 'bestRating' => 5, 'ratingCount' => $stampedDBData['count'], 'reviewCount' => $stampedDBData['count'], ]; } return $entity; });
Let us know.
Hi there, I installed the code but am only seeing 1 review show up for my product: https://themoonjoy.com/product/moon-phase-poster-print/ I have over 50 in the system and its showing up on the main reviews https://themoonjoy.com/reviews/
Hello,
I tried to look into your theme files but I couldn’t find where you the stamped io script in the sensitive section is added at.
To work with their script you will need to replace
"@id": "HTTPS://STORE.COM/URL/#product"
with a function to get current product URL then concatenate it to the #product. For example:"@id": "get_the_permalink( $post ) . '#product';"
whereget_the_permalink( $post )
gets the product URL. Once that’s done, the reviews should work perfectly from the plugin.Looking forward to helping you. Thank you.
Thank you this has been resolved.
- This reply was modified 4 years, 2 months ago by Jeremy.
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.
The ticket ‘Support to integrate Stamped.io’ is closed to new replies.