Product Price Showing on Google Search Results – Woocommerce Schema
-
Hi,
On our website we have our pricing hidden to users who are not logged in. Starting on 1/23/23 we noticed that google had begun indexing our product pricing on google search.
We have the below code in function.php to prevent this from showing, and the first 2 snippets have been on the site since launch a few months ago.
/* Very Important: Hides pricing from Google Search Results */ add_filter( 'woocommerce_structured_data_product_offer', '__return_empty_array' ); /* Very Important: Remove all product structured data.*/ function ace_remove_product_structured_data( $types ) { if ( ( $index = array_search( 'product', $types ) ) !== false ) { unset( $types[ $index ] ); } return $types; } add_filter( 'woocommerce_structured_data_type_for_page', 'ace_remove_product_structured_data' ); /* Very Important: Removes Product Price - Atempt as of 1-23-23.*/ function wc_remove_some_structured_data( $markup ) { unset( $markup['offers'] ); return $markup; } add_filter( 'woocommerce_structured_data_product', 'wc_remove_some_structured_data' );
Additionally, this meta tag still shows when inspecting the page, and not being logged in.
Would anyone have any recommendations on how we can stop the pricing from showing?
Thank you for your time and have a great day,
The page I need help with: [log in to see the link]
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘Product Price Showing on Google Search Results – Woocommerce Schema’ is closed to new replies.