Skip to content

Instantly share code, notes, and snippets.

@corsonr
Last active Jun 22, 2017
Embed
What would you like to do?
WooCommerce 3: disable JSON/LD format
<?php // Do not include this if already open! Code goes in theme functions.php.
/*
* Remove the default WooCommerce 3 JSON/LD structured data format
*/
function remove_output_structured_data() {
remove_action( 'wp_footer', array( WC()->structured_data, 'output_structured_data' ), 10 ); // Frontend pages
remove_action( 'woocommerce_email_order_details', array( WC()->structured_data, 'output_email_structured_data' ), 30 ); // Emails
}
add_action( 'init', 'remove_output_structured_data' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment