• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

Remove Meta Per Single Product – WooCommerce

Need to remove, category and tag links from a single product?

There’s 2 steps. (1) The input and (2) the output.

Step 1 – You can use WordPress custom fields or a plugin like ACF to create a custom field named remove_meta.

Here’s the .json import file for ACF which sets up your field otherwise create a WordPress field like this :

Step 2 – Paste this PHP code at the end of your child themes functions file.

add_action( 'woocommerce_single_product_summary', 'remove_single_meta', 39 );
function remove_single_meta() {

if ( ! empty( get_post_meta( get_the_ID(), 'remove_meta', true ) ) ) {

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );

}}

Custom Fields WooCommerce

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.