Stamped Review not working

#30221
  • Resolved Tony
    Rank Math free

    Hello,
    i posted a while back with the issue that there is a conflict between rankmath and stamped review plugin. They suggest me to add this code:
    <script>

    function addEventListenerStamped(el, eventName, handler) {

    if (el.addEventListener) { el.addEventListener(eventName, handler); }
    else { el.attachEvent(‘on’ + eventName, function () { handler.call(el); }); }

    }

    addEventListenerStamped(document, ‘stamped:reviews:loaded’, function(e) {
    var ratingCount = jQueryStamped(‘meta[itemprop=”reviewCount”]’).attr(‘content’);
    var ratingValue = jQueryStamped(‘meta[itemprop=”ratingValue”]’).attr(‘content’);

    var richSnippet = {
    “@context”: “http://schema.org”,
    “@type”: “Product”,
    “@id”: “https://STORE.COM/URL/#product”
    }

    if (parseInt(ratingValue) > 0){
    richSnippet.aggregateRating = {
    “@type”: “AggregateRating”,
    “ratingValue”: ratingValue,
    “reviewCount”: ratingCount
    }
    }
    var script = document.createElement(‘script’);
    script.type = ‘application/ld+json’;
    script.innerHTML = JSON.stringify(richSnippet);
    document.getElementsByTagName(‘head’)[0].appendChild(script);
    });
    </script>

    While wating for rankmath intergrate this code to solve the conflict, i get a short term solution to add this code from supportert:
    /**
    * Filter to Short-circuit Schema if a 3rd party is interested in generating their own data.
    * Replace $schmea_type with schema name like article, review, etc.
    * @param bool $value true/false Default false
    * @param array $parts Post Data
    * @param array $data Schmea Data
    *
    * @return bool
    */
    add_filter( “rank_math/snippet/rich_snippet_review”, function( $value, $parts, $data ) {
    return true;
    }, 10, 3 );

    but it also not seams to work. I want to ask if you guys already got a solution

Viewing 6 replies - 1 through 6 (of 6 total)
  • Todd
    Rank Math free

    Hello,

    Thanks for getting in touch with us.

    Do you wish to disable the rich snippets in Rank Math?

    You can do that from WordPress Dashboard > Rank Math > Dashboard

    Disable the Rich Snippets module.

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

    Tony
    Rank Math free

    i still need the rich snippet Preis and Stock status, the only Problem was Rankmath Review Snippet is not working with yotpo or stamped. Stamped already give the code and say if you add the code above to rank math it should work and show review.

    Hello,

    Thank you for contacting Rank Math today.

    I believe that you should add the stamped product review code on the <head> of your site to add the reviews from their app. If you have not done this already then you can use the headers and footer injector plugin to add this snippet to your site header.

    Next, you can remove the Rank Math review data from your products by adding this snippet on your theme’s functions.php file:

    /**
     * Filter to modify schema data.
     * @brand for products
     * @param array $entity Snippet Data :        
     * @return array
     */
    
    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
    	unset($entity['aggregateRating']);
    	unset($entity['review']);
    	return $entity;
    });

    Looking forward to helping you. Thank you.

    ​​​​​​

    Tony
    Rank Math free

    i add these code, but still doesn’t see that is working

    Hello,

    Thank you for getting back to us and sorry for the delay.

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

    Todd
    Rank Math free

    Hi Tony,

    The code is just changing the value of some schema fields.

    We cannot add this in our plugin. Also, Rank Math no longer supports Review schema as per GOogle’s guidelines:
    https://webmasters.googleblog.com/2019/09/making-review-rich-results-more-helpful.html

    You can use our converter to convert review schema or you can use the filter to prevent Rank Math from adding the review schema.
    https://rankmath.com/kb/how-to-fix-review-schema-errors/

    https://rankmath.com/kb/filters-hooks-api-developer/#remove-schema-data-from-posts

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

The ticket ‘Stamped Review not working’ is closed to new replies.