• Resolved jaspash

    (@jaspash)


    As far as I know Woocommerce generate the schema markup for products to allow Google to show product microdata as Price and Stock.

    I need to hide the Product Price & Stock From Google indexing. I found and pasted this code in my function.php two weeks ago file but it doesn’t seem to work.

    Can you confirm to me that this is the correct code?

    function wc_remove_some_structured_data( $markup ) {
         unset( $markup['offers'] );
         return $markup;
    }
    add_filter( 'woocommerce_structured_data_product', 'wc_remove_some_structured_data' );
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter jaspash

    (@jaspash)

    I also found this code, but I think this code remove all the markup: Rating, Reviews, Prices, etc. I just need to remove the Price (only the price).

    /**
     * @snippet       Hide Price & Stock @ Google
     * @how-to        Get CustomizeWoo.com FREE
     * @author        Rodolfo Melogli, BusinessBloomer.com
     * @testedwith    WooCommerce 6
     * @donate $9     https://businessbloomer.com/bloomer-armada/
     */
     
    add_filter( 'woocommerce_structured_data_product_offer', '__return_empty_array' );
    Igor H

    (@ihereira)

    Hello,

    As an alternative solution, you can check this premium extension: Catalog visibility options, it will help you to convert your WooCommerce store into a catalog, without prices and without permitting purchases. ?Then it is expected that search engines like Google will look at your site and products, it will see there are no prices, and that way, prices will not be visible on search engines like Google.

    I hope this helps.

    Hi there!

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please start a new thread.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to Hide Product Price & Stock From Google indexing?’ is closed to new replies.