Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save majeedraza1/10776a69f8a21c09eedf41ffdb2dd7e8 to your computer and use it in GitHub Desktop.
Save majeedraza1/10776a69f8a21c09eedf41ffdb2dd7e8 to your computer and use it in GitHub Desktop.
/*
* 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