Removes the default structured data (schema markup) generated by the WooCommerce plugin to prevent duplicate schema issues. This is useful when another SEO plugin or custom schema is already handling structured data, helping avoid conflicts and improving SEO consistency.
add_action('init', 'prefix_remove_wc_structured_data');
function prefix_remove_wc_structured_data() {
if (function_exists('WC')) {
// Remove frontend structured data
remove_action('wp_footer', array(WC()->structured_data, 'output_structured_data'), 10);
// Remove email structured data
remove_action('woocommerce_email_order_details', array(WC()->structured_data, 'output_email_structured_data'), 30);
}
}