• Resolved cmht

    (@eightsages)


    Hi,

    We are using WooCommerce with a number of variation products listed. We are having problems with variation listings rejected by Google Merchant Centre because of price mismatches in the structured data.

    Would like to know if Rankmath changes the structured data from the WooCommerce default?

    If it does, how do we restore the structred data back to the WooCommerce original?

    Thanks

    Chris

Viewing 15 replies - 1 through 15 (of 20 total)
  • Hi Chris,

    Yes it does change it, it shows the price of the cheapest variation which is wrong for all other variations.

    Thread Starter cmht

    (@eightsages)

    Hi @supportadtribes thanks for getting back!

    We had purchased Product Feed Elite to overcome this problem, but Eva on your support team then told us that it doesn’t work if the default WooCommerce structured data has been changed.

    We weren’t sure at the time what plugin / theme had caused this change.

    So now we know it’s Rankmath.

    Any idea what settings we could change / modify in RankMath to restore the default structured data for variation products?

    Cheers
    Chris

    Hi Chris,

    I believe Rankmath has a structured data feature setting in it somewhere (we don’t know their UI exactly) but make sure it is disabled.

    Thread Starter cmht

    (@eightsages)

    Thanks @supportadtribes.

    Hi @rankmath, we don’t want to turn off structured data completely, but only for variation products.

    Could you advise how to do this please?

    Would the solution posted here work? :
    https://support.rankmath.com/ticket/woocommerce-variants-vs-google-shopping/

    Thanks all

    Thread Starter cmht

    (@eightsages)

    Hi @rankmath , any advice here please? Thanks!

    Plugin Author Rank Math

    (@rankmath)

    Hello @eightsages

    Thank you for contacting the support and sorry for the delayed response and any inconvenience that might have been caused due to that.

    Here’s a filter code to remove Product schema on Variation Product:

    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
    	$product = wc_get_product( get_the_ID() );
    	if ( $product->is_type('variable') ) {
    		return [];
    	}
    	return $entity;
    });

    Hope that helps.

    Thread Starter cmht

    (@eightsages)

    Thanks @rankmath

    Can this be coded instead as below? Am more used to this format: :p

    add_filter( ‘rank_math/snippet/rich_snippet_product_entity’);
    function( $entity ) {
    $product = wc_get_product( get_the_ID() );
    if ( $product->is_type(‘variable’) ) {
    return [];
    }
    return $entity;
    }

    Thread Starter cmht

    (@eightsages)

    @rankmath
    Jfyi we are using Woocommerce 3.9.3 and WordPress 5.3.4

    • This reply was modified 4 years, 2 months ago by cmht.
    Plugin Author Rank Math

    (@rankmath)

    Hello @eightsages

    We have tested the code with the latest version of WooCommerce and WordPress.

    You would need to test this on a staging site first or update to the latest version of WC.

    Hope that helps. Thank you.

    Thread Starter cmht

    (@eightsages)

    Hi @rankmath

    Just checking, the code given on your support page here was dated 5mths 4weeks ago (the very last entry in the thread from Michael Davis):

    https://support.rankmath.com/ticket/woocommerce-variants-vs-google-shopping/

    1) Does it serve the same purpose as the code you’ve provided here?
    2) Was it based on the latest version of Woocommerce and WordPress at the time?

    Thanks so much for the help!

    • This reply was modified 4 years, 2 months ago by cmht.
    • This reply was modified 4 years, 2 months ago by cmht.
    Plugin Author Rank Math

    (@rankmath)

    Hello @

    Does it serve the same purpose as the code you’ve provided here?

    The code we provided him was to remove the Schema data from the Product variation page and the support ticket code is to remove the product:price meta tag. So both the codes are different. You can use both or any one of the codes depending on your requirement.

    Was it based on the latest version of Woocommerce and WordPress at the time?
    Yes. The code provided at that time must have been tested on the latest versions.

    Hope that helps.

    Thread Starter cmht

    (@eightsages)

    thanks @rankmath !

    We’ll try the code you’ve provided here and keep you posted on how that goes.

    Appreciate your support ??

    Thread Starter cmht

    (@eightsages)

    Hi @rankmath !

    Could you let us know please how to verify if the code has worked?

    Our variation product pages are still showing tags such as <meta property=”product:price:amount” content=”788″>. Example: https://prnt.sc/uhd0eo

    Here’s the actual link: https://eldercare.market/product/nissin-lightweight-detachable-pushchair-foldback-with-assisted-brakes/

    Does this mean that the Product Schema for these pages has not been removed?

    Thanks
    Chris

    Plugin Author Rank Math

    (@rankmath)

    Hello @eightsages

    Please use following the filter code to remove the product price & currency tags:

    add_filter( "rank_math/opengraph/facebook/product_price_amount", function( $price ) {
    	$product = wc_get_product( get_the_ID() );
    	if ( $product->is_type('variable') ) {
    		return false;
    	}
    	return $price;
    });
    add_filter( "rank_math/opengraph/facebook/product_price_currency", function( $currency ) {
    	$product = wc_get_product( get_the_ID() );
    	if ( $product->is_type('variable') ) {
    		return false;
    	}
    	return $currency;
    });

    Also, I noticed the Schema data is showing blank array on your page. Since you are not using BreadcrumbList Schema, you can remove the Schema data completely on the variable product page by using the following code:

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {
    	$product = wc_get_product( get_the_ID() );
    	if ( $product->is_type('variable') ) {
    		return false;
    	}
    	return $data;
    }, 99, 2);

    Hope that helps. Thank you.

    Thread Starter cmht

    (@eightsages)

    Hi @rankmath ,

    The first two filter code seemed to work, as those tags are no longer visible ??

    The third filter however, crashed our site completely, so we cannot use it.

    We’ll start with the first two in our live site, and monitor our Google Merchant Centre. Hopefully our variation products will stop being rejected now!

    Really appreciate your assistance ??

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Google Shopping variation price rejections’ is closed to new replies.