Skip to content

Instantly share code, notes, and snippets.

@corsonr
Last active June 22, 2017 15:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corsonr/163967563f92ae3e145ed1fda61f8c72 to your computer and use it in GitHub Desktop.
Save corsonr/163967563f92ae3e145ed1fda61f8c72 to your computer and use it in GitHub Desktop.
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