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 );
}}
Reviews
There are no reviews yet.