• Resolved thimy

    (@thimy)


    Hi AIO SEO team,

    i search a way to hide price of commerce in google page result.

    Indeed i hide all my price and there are only visible when customers are login, but the price appear in result of google “because” of your script plugin.

    How can i remove the part of script for product in your plugin? Specially this one :

    “offers”:[{“@type”:”Offer”,”price”:”34.00″,”priceValidUntil”:”2025-12-31″,”priceSpecification”:{“price”:”34.00″,”priceCurrency”:”EUR”,”valueAddedTaxIncluded”:”false”},”priceCurrency”:”EUR”,

    Do you have a tip with a snippet or anything more? Thanks for your support, cheers.

    • This topic was modified 8 months, 2 weeks ago by thimy.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author arnaudbroes

    (@arnaudbroes)

    Hey @thimy,

    I assume that you’re using AIOSEO Pro since Product schema is a feature. If so, please reach out to us at https://aioseo.com/contact since we technically aren’t allowed to help you here as a Pro customer due to the www.remarpro.com guidelines.

    That being said, if you want to remove the price from our Product schema, I recommend that you completely remove the Product schema by changing the default graph for the WooCommerce Product post type under AIOSEO > Search Appearance > Content Types > Products > Schema. Price is a required property in Product schema so if you were to remove it, Google will no longer show rich snippet results for your products and instead throw errors in Google Search Console.

    Let me know if that makes sense.

    Thread Starter thimy

    (@thimy)

    Hey, thanks for your answer, i understand that you want sell your Pro version but i use the free plugin.

    So I looked for a way to override woocommerce schema instead of doing it through your plugin and implemented a snippet like this which works perfectly to remove “offers > prices” in schema :

    function bs_product_delete_meta_price( $product = null ) {
    	if ( ! is_object( $product ) ) {
    		global $product;
    	}
    
    	if ( ! is_a( $product, 'WC_Product' ) ) {
    		return;
    	}
    
    	if ( '' !== $product->get_price() ) {
    		$shop_name = get_bloginfo( 'name' );
    		$shop_url  = home_url();
    
    		$markup_offer = array(
    			'@type'         => 'Offer',
    			'availability'  => 'https://schema.org/' . $stock = ( $product->is_in_stock() ? 'InStock' : 'OutOfStock' ),
    			'seller'        => array(
    				'@type' => 'Organization',
    				'name'  => $shop_name,
    				'url'   => $shop_url,
    			),
    		);
    	}
    
    	return $markup_offer;
    }
    add_filter( 'woocommerce_structured_data_product_offer', 'bs_product_delete_meta_price' );

    I assume that Google don’t index this part and Search console return an error but my customer sell those products in b2b and its customers do not want to see the prices displayed.

    If you think there is another solution, please let me know i’m curious to try it ??

    Plugin Author arnaudbroes

    (@arnaudbroes)

    Hey @thimy,

    Not trying to sell our Pro version, I just thought you were using it since you were asking about Product schema, which is one of our Pro features. ??

    Anyway, that looks like a good solution to me. I would probably just completely remove the Product schema from WooCommerce in this case since Google isn’t going to use it, but otherwise this should work.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hide price woocommerce’ is closed to new replies.