Assistance Needed: Blocking Price Data Schema in RankMath

#920802
  • Resolved Juan D Santamaría
    Rank Math free

    Dear team,

    I hope this email finds you well.

    We’ve installed your fantastic SEO plugin, RankMath, on our website, https://mobipark.com/ and have encountered an issue that we’d appreciate your help resolving. Let me provide some context:

    At Mobipark, we manufacture equipment for parks and sports areas. Our WooCommerce-based product catalog has the following setup:

    • For non-logged-in users, prices are hidden, and they can only request a quote.
    • For logged-in distributors, prices are displayed based on their specific commercial rates, configured by customer groups.

    To ensure this setup is search-engine compliant, we used a WooCommerce hook to block price Schema data from being indexed by search engines. However, we’ve noticed that RankMath seems to access and include Schema data from product pages, making the price information visible in search engine results.

    This is causing issues, as customers see a different price on search engines compared to what we charge based on their respective rates.

    Could you please advise how to prevent Google and other search engines from indexing or displaying the Price Schema data?

    Thank you in advance for your time and support. I look forward to hearing your recommendations.

    Best regards,

    Juan Santamaría

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you so much for getting in touch.

    Please note that removing the price from the product schema will render errors in the Rich Result so if wish to remove that information for non-logged in users, you can simply use the following code:

    add_filter('rank_math/snippet/rich_snippet_product_entity', function ($entity) {
    	if(is_user_logged_in()){
    		return false;
    	}
    	return $entity;
    });

    Or, if you really want the price property to be removed, here’s a different code you can use:

    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
    	if (is_user_logged_in() && isset( $entity['offers'] ) ) {
    		unset( $entity['offers'] );
    	}
    	
    	return $entity;
    } );

    Hope that helps.

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

The ticket ‘Assistance Needed: Blocking Price Data Schema in RankMath’ is closed to new replies.