Last active
June 22, 2017 15:57
-
-
Save corsonr/163967563f92ae3e145ed1fda61f8c72 to your computer and use it in GitHub Desktop.
WooCommerce 3: disable JSON/LD format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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