structured data attributes

#73294
  • Resolved Thibaut Fontaine
    Rank Math pro

    Hi,

    I’m using only variable products in my shop.

    By default, structured data sent by rankmath uses the ” Aggegate offers ” attribute.

    But google does not recommend this attribute for variable products as explained in this article: https://support.google.com/merchants/answer/6386198?hl=en in the products variants paragraph.

    How can I tell google that there are multiple prices on the page?

    Thank you in advance !

Viewing 4 replies - 16 through 19 (of 19 total)
  • Hi,

    Please use this filter in your theme’s functions.php file:

    add_filter( "rank_math/snippet/rich_snippet_product_entity", function( $entity ) {
    	$entity['offers']['priceValidUntil'] = '2025-12-31';
    	
    	return $entity;
    });

    Here is another set of code you can try: https://support.rankmath.com/ticket/how-set-pricevaliduntil/?view=all#post-37978

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

    Hi Uzair,

    When I’m added your code :

    add_filter( "rank_math/snippet/rich_snippet_product_entity", function( $entity ) {
    	$entity['offers']['priceValidUntil'] = '2025-12-31';
    	
    	return $entity;
    });

    The price Attribut is missing.

    It’s good thanks !

    Alberto
    Rank Math business

    Hello Thibaut,

    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.

Viewing 4 replies - 16 through 19 (of 19 total)

You must be logged in to reply to this ticket.