How To Remove WooCommerce JSON/LD Structured Data


/ Published in: PHP
Save to your folder(s)

Going through the templates and removing really isn’t an ideal solution here. Luckily there is a single function you can add to your child theme’s functions.php file that will disable this.


Copy this code and paste it in your HTML
  1. /* Remove the default WooCommerce 3 JSON/LD structured data */
  2. function remove_output_structured_data() {
  3. remove_action( 'wp_footer', array( WC()->structured_data, 'output_structured_data' ), 10 ); // This removes structured data from all frontend pages
  4. 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
  5. }
  6. add_action( 'init', 'remove_output_structured_data' );

URL: https://www.prodjex.com/2018/04/remove-the-woocommerce-json-ld-structured-data-format/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.