WooCommerce PHP Beginner Requires WooCommerce

Hide the SKU, Categories and Tags on Product Pages

Remove the "SKU: … Category: … Tags: …" line from single product pages, or hide only the SKU.

Tested on WordPress 7.1 PHP 8.3 Updated
functions.php 7 lines
// Hide the whole SKU / Category / Tags block.
add_action( 'init', function (): void {
	remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
} );

// Or keep categories and tags but hide only the SKU on the front end:
// add_filter( 'wc_product_sku_enabled', fn () => is_admin() );

Where to add this

Recommended A code snippets plugin Survives theme changes and is easy to switch off.
Child theme At the end of your child theme's functions.php file.
Must-use plugin As a .php file in wp-content/mu-plugins, starting with <?php.

Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.

Under the Add to cart button, WooCommerce prints the SKU, categories and tags. SKUs are useful internally but mean little to shoppers. This snippet removes that line, or just the SKU.

How it works

The meta block is printed by woocommerce_template_single_meta on woocommerce_single_product_summary at priority 40. Removing that action hides it on every product page.

The commented-out alternative uses wc_product_sku_enabled. Returning is_admin() keeps SKUs working in wp-admin and hides them on the front end.

Things to watch

  • Use one option or the other, not both.
  • Block themes print this information with the Product Meta block in the Single Product template. Remove or edit the block there.

How to test it

Open a product page. The SKU, category and tag line should be gone.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only