Remove WooCommerce Generated Product Schema

Insert code inside functions.php to remove the generated product schema markup from the Product Category and Shop page of WooCommerce

/**
 * Remove the generated product schema markup from the Product Category and Shop pages.
 */
function wc_remove_product_schema_product_archive() {
	remove_action( 'woocommerce_shop_loop', array( WC()->structured_data, 'generate_product_data' ), 10, 0 );
}
add_action( 'woocommerce_init', 'wc_remove_product_schema_product_archive' );

function wc_remove_output_structured_data() { 
	remove_action( 'wp_footer', array( WC()->structured_data, 'output_structured_data' ), 10 ); 
	remove_action( 'woocommerce_email_order_details', array( WC()->structured_data, 'output_email_structured_data' ), 30 ); } 
add_action( 'init', 'wc_remove_output_structured_data' );

Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.