The WPFolks app is out on iPhone and Android. Free, no ads. Download on the App Store Get it on Google Play
Skip to main content
Login Join
Snippet · PHP

Remove Duplicate Schema in WooCommerce

Shared by Nikul Valani · May 1, 2026 · @init, wp_footer, woocommerce_email_order_details

104 views
3 upvotes
Back to Snippets

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);
    }
}
Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

0 comments

Proudly supported by