WooCommerce products have reviews, but missing “review” rich snippet

#88142
  • Resolved CDR
    Rank Math free

    Hello!

    I use WooCommerce products, and all of them use Rank Math’s “Product Schema”.

    10 days ago, all products had complete “Product Schema” rich snippets in Google Search Console. Today, I noticed the warning in Google Search Console: Missing field “review”

    So I checked using Google’s Rich Results Test, and confirm the review field is missing on all products.

    In other support tickets, you write:

    “Please acquire some reviews and ratings to get rid of the ‘aggregateRating’ and ‘review’ warnings.“.

    All my products have reviews, and aggregateRating and all other “Product Schema” rich snippets are working perfectly. review field is the only thing missing.

    I believe recent changes I’ve done must have broken the review field. I have:

    • I updated Rank Math plugin
    • I used SG Optimizer plugin to minify and combine various CSS / JavaScript files
    • I used Asset CleanUp plugin to preload some local fonts (.woff / .woff2)
    • Something else?

    When I try to reverse the changes, review field is still missing — I don’t know what else to try. Do you have any ideas how to restore the review field?

    Thank you!

    • This topic was modified 3 years, 6 months ago by CDR.
Viewing 15 replies - 16 through 30 (of 36 total)
  • Hello,

    @CDR, with which URL are facing this issue? Could you please share in the sensitive section so we can check.?

    You can also try rolling back to a previously working version in Rank math > Status & Tools > Version Control and see if the issue is resolved with that version. Do let us know if it does.

    Looking forward to helping you. Thank you.

    ​​​​​​

    CDR
    Rank Math free

    Michael, thanks for your continued support.

    • IMPORTANT NEW INFO: After rolling back to Version 1.0.47.1, the issue appears to be fixed.
    • I also tried Versions 1.0.48, 1.0.48.1, and 1.0.48.2. Each of these versions reproduce the bug.

    Other people in this thread may benefit from this new info too. @.Simone @.Russell @.Espede @.Tapparit Rukthawornwong @.Data Stream

    @.Michael I will now provide you example URLs that reproduce the bug on 1.0.48+ and extend a temporary login access for you.

    Sajid Khan
    Rank Math business

    Hello,

    We released a quick Beta update you can try to see if that helps.

    Please enable the Beta update by following this:
    https://rankmath.com/kb/version-control/#beta-updates

    beta update

    If you are unable to see an update, please clear Rank Math’s transients from:
    WP Dashboard > Rank Math > Status & Tools > Database Tools > Remove Rank Math Transients > Remove transients
    remove transients rank math

    Please clear the caches, server, and WordPress after updating.

    You can disable the Beta updates once you update to the latest version and if the issue is fixed.

    We are here to assist. Thank you.

    CDR
    Rank Math free

    Sajid,

    I have enabled Beta Opt-In, and cleared Rank Math transients, cleared cache, but I do not see a beta version available for upgrade. 1.0.48.2 is the still the latest version available. Please advise, thanks!

    • This reply was modified 3 years, 5 months ago by CDR.
    CDR
    Rank Math free

    Sajid,

    I have enabled Beta Opt-In, and cleared Rank Math transients, cleared cache, but I do not see a beta version available for upgrade. 1.0.48.2 is the still the latest version available. Please advise, thanks!

    Sajid Khan
    Rank Math business

    Hello,

    Thank you for contacting Rank Math today.

    The latest version of Rank Math is 1.0.49, please check screenshot and install.
    https://i.mythemeshop.com/9ufqFt

    Looking forward to helping you. Thank you.

    ​​​​​​

    CDR
    Rank Math free

    Sajid,

    • I updated to 1.0.49. 1.0.49 reproduces the bug. Not fixed.
    • Now I have rolled back to 1.0.47.1 again, since this is the latest version without the bug.

    Approaching a fortnight now and what would appear to be a bug introduced with 1.0.48 is still not fixed.

    I carefully read the release notes with 1.0.49 and was disappointed not to read of a fix for this bug, so I am not surprised it doesn’t help.

    I’m left wondering what testing in the WooCommerce product environment was done before the release of 1.0.48 that this bug has materialized for so many of us? And I’m sure many more who haven’t joined this thread are impacted too.

    i see the even the diligent polite @.CDR who first raised this issue is now sounding exasperated.

    It’s all very well being ‘here to assist’ and ‘looking forward to helping’. Makes it sound like it’s our problem, something wanting with our sites, when in fact, on all the evidence it looks to me that RM have introduced a bug.

    if I’m wrong, I apologize in advance, but as things are I’m exasperated.

    Regards,
    Barry

    Hello,

    It seems like new tables are not getting created in the Database or some old plugin has left an incorrect entry.

    Please follow these steps to fix the issue
    https://rankmath.com/kb/fatal-error-after-1-0-49-update/

    Only follow the first 2 steps.

    Hi Uzair and RM in general,

    Why would one apply a fix for a problem that’s not what people in this thread are wanting addressed?

    Speaking personally, I don’t have time to go on wild goose chases.

    What I and I imagine others on this thread want is a recognition that a bug was introduced with 1.0.48 that caused the ‘review’ property to go missing from the schema when it had been there previously for long established products. Following that recognition, a fix for the issue.

    Kind regards,
    Barry

    Solution:

    /wp-content/plugins/seo-by-rank-math/includes/modules/schema/snippets/class-product-woocommerce.php
    on line 205 remove “[]

    Change this:

    $entity['review'][] = [

    to:

    $entity['review'] = [

    Hi Ozan,

    Thank you for the suggestion. I have tried it and it works partially. The Google Rich Results Test is now happy, but only the first review of a product is included. So where a product has n > 1 reviews, only the first is in the rich result.

    PHP is not my first language, so how to get the array back? I’ll research, but others may be quicker.

    Did have ` “review”: [{
    “@type”: “Review”,
    “@id”: “https:\/\/www.staging1.datastream.world\/the-cheeky-possum\/#li-comment-217”,
    “description”: “My children adore this book! We read it together all the time! Thanks for the quick delivery!”,
    “datePublished”: “2019-11-13 16:19:26”,
    “reviewRating”: {
    “@type”: “Rating”,
    “ratingValue”: 5
    },
    “author”: {
    “@type”: “Person”,
    “name”: “Caroline Wells”,
    “url”: “”
    }
    }, {
    “@type”: “Review”,
    “@id”: “https:\/\/www.staging1.datastream.world\/the-cheeky-possum\/#li-comment-214”,
    “description”: “We love this book! A very well written story with lovely illustrations. Thank you Datastream for getting the copies to us. \r\nMy boys love this book and we read it all the time. A good present or to one to keep for the bookshelf! \r\nThank you!”,
    “datePublished”: “2019-11-12 09:33:23”,
    “reviewRating”: {
    “@type”: “Rating”,
    “ratingValue”: 5
    },
    “author”: {
    “@type”: “Person”,
    “name”: “Bex McCartney”,
    “url”: “”
    }
    }, {
    “@type”: “Review”,
    “@id”: “https:\/\/www.staging1.datastream.world\/the-cheeky-possum\/#li-comment-171”,
    “description”: “Thank you for such a speedy delivery . What a delightful book, very Australian and full of fun. A wonderful bedtime story loved by my grandchildren. \r\n\r\nThank you \r\nVal”,
    “datePublished”: “2019-08-06 17:09:00”,
    “reviewRating”: {
    “@type”: “Rating”,
    “ratingValue”: 5
    },
    “author”: {
    “@type”: “Person”,
    “name”: “valerie southam”,
    “url”: “”
    }
    }, {
    “@type”: “Review”,
    “@id”: “https:\/\/www.staging1.datastream.world\/the-cheeky-possum\/#li-comment-170”,
    “description”: “Thank you Data Stream for your quick turn around on delivering our copies of The Cheeky Possum. My children love it so much that we also donated two copies to our primary school. \r\nWe read The Cheeky Possum often and it’s a favourite amongst our book collection. \r\n\r\nThank you\r\nDonna”,
    “datePublished”: “2019-08-06 12:21:02”,
    “reviewRating”: {
    “@type”: “Rating”,
    “ratingValue”: 5
    },`
    With your suggestion, only `”review”: {
    “@type”: “Review”,
    “@id”: “https://www.datastream.world/the-cheeky-possum/#li-comment-170”,
    “description”: “Thank you Data Stream for your quick turn around on delivering our copies of The Cheeky Possum. My children love it so much that we also donated two copies to our primary school. \r\nWe read The Cheeky Possum often and it’s a favourite amongst our book collection. \r\n\r\nThank you\r\nDonna”,
    “datePublished”: “2019-08-06 12:21:02”,
    “reviewRating”: {
    “@type”: “Rating”,
    “ratingValue”: 5
    },
    “author”: {
    “@type”: “Person”,
    “name”: “Donna Brunning”
    }
    },`

    Many thanks for the research.

    Kind regards,
    Barry

    **** ATTENTION RM DEVELOPERS ****

    Hi Again Ozan,

    Ok, the real problem is in /wp-content/plugins/seo-by-rank-math/includes/modules/schema/class-jsonld.php at line 159

    // Remove empty review.
        if ( 'review' === $id ) {
            if ( ! isset( $value['reviewRating'] ) || ! isset( $value['reviewRating']['ratingValue'] ) ) {
        unset( $data[ $id ] );
        continue;
    	}
        }

    because $value is a multi-dimensional array, so the test isset( $value[‘reviewRating’] is null, but isset( $value[0][‘reviewRating’], etc. have values. So the reviews are always removed if the first array dimension is ignored.

    The code in class-jsonld.php has had a major update compared with a copy I have from 1.0.44. That older version does not have the //Remove empty review comment. The whole file is greatly revised.

    Now, as said, I’m not fluent in PHP, so please someone who is, post how the array should be handled at //Remove empty review. Or better yet, RM to fix.

    BTW, I used phpStorm to step through the code. There I saw that ‘review’ was in the $entity array in class-product-woocommerce.php even without the change Ozan suggested, but it disappeared later. Now we know where.

    HTH,
    Barry

    editing…

    Hello,

    We released a beta update that fixes the issue you mentioned.

    Please opt-in by enabling this option and updating the plugin manually:
    https://rankmath.com/kb/version-control/#beta-updates

    Once updated, please update here if the issue’s resolved.

    Looking forward to hearing from you. Thank you.

    P.S. You can read the changelog here:
    https://rankmath.com/changelog/#beta

Viewing 15 replies - 16 through 30 (of 36 total)

The ticket ‘WooCommerce products have reviews, but missing “review” rich snippet’ is closed to new replies.