Skip to content

Instantly share code, notes, and snippets.

@zstepek
Last active May 7, 2024 14:42
Show Gist options
  • Save zstepek/597c2091abaac7811bb3 to your computer and use it in GitHub Desktop.
Save zstepek/597c2091abaac7811bb3 to your computer and use it in GitHub Desktop.
Remove product meta (SKU, tags, etc) from WooCommerce single product pages.
/* Remove product meta */
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
@rickslayer
Copy link

Thanks you very much! Works!!

@GnesisBe
Copy link

GnesisBe commented Jan 2, 2019

Thx :)

@sanderlt
Copy link

cheers

@subhashraj1413
Copy link

Thanks

@carmolim
Copy link

And if that din't work?

@tamara-m
Copy link

This still works 2 days away from 2022.

@carmolim If that didn't work right off, you need to hook it to an action that comes before, like this

/**
* Remove hooked actions from single product template to remove unwanted elements
*
*/
public function remove_single_product_elements(){
     remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40);
}
add_action('woocommerce_before_single_product', 'remove_single_product_elements' );

@tamara-m
Copy link

@Jakours
Copy link

Jakours commented Sep 28, 2022

Hello!

Nice, but what if i just want to remove the link (words stay there)?

Add this css snippet

.product_meta{
cursor: default;
pointer-events: none;
text-decoration: none;
}

@NanetteG
Copy link

Hopefully I can jump in on this thread! Currently, my product meta includes SKU, Tags, Category, GTIN, MPN, and Brand. I would like to remove Tags, GTIN, MPN, and Brand....leaving only the SKU and Category. Could you possibly assist with the correct CSS to accomplish this? Many thanks!!!

@zstepek
Copy link
Author

zstepek commented Dec 18, 2023

@NanetteG using a child theme, add a copy of /woocommerce/templates/single-product/meta.php to your child theme at themes/your-theme/woocommerce/single-product/meta.php, then edit the file to only show the data you’d like to display.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment