If you want to have full control over how you like your website to be displayed on the search results using schema markups in WooCommerce, read this article till the end!
When I set up my store on WooCommerce, I was curious to know what markups have been implemented on WordPress by default. I went on to google structured data testing tool and ran a test for my site.
To my surprise, it showed product schema with 3 warnings, because it didn't mention sku, mpn for my products. But I did not add any product schema to my site. I then did some research on that. I found out that, WooCommerce 3 introduced a new format to structured product data called JSON/LD which is overall a big improvement from WooCommerce 2.xx.
What they do is they automatically create structured data in the back end, so that you don't need to add them manually.
But if you like to have more control over structured data like me, then follow the steps to remove WooCommerce structured data from your site.
- Install Code Snippets plugin on WordPress.
- Add a snippet, and put the following code into it.
/* Remove the default WooCommerce 3 JSON/LD structured data */ function remove_output_structured_data() { remove_action( 'wp_footer', array( WC()->structured_data, 'output_structured_data' ), 10 ); // This removes structured data from all frontend pages remove_action( 'woocommerce_email_order_details', array( WC()->structured_data, 'output_email_structured_data' ), 30 ); // This removes structured data from all Emails sent by WooCommerce } add_action( 'init', 'remove_output_structured_data' )
Using this, all the default schemas will be scrapped off from your site, and that way you can add your own custom-coded schema markups to your product pages and show whichever snippets however you want to.