How to Hide Product Category on WooCommerce Product Pages – 2026

Last updated on November 23rd, 2024 at 07:49 am

Displaying product categories on WooCommerce product pages can be helpful for navigation, but there may be times when you want a cleaner look by hiding these categories. Whether it’s for design or branding purposes, hiding the category can help simplify the product page layout and focus customers’ attention on the product details.

In this guide, we’ll show you how to hide the category display on WooCommerce product pages without using a plugin.


Step 1: Use CSS to Hide Product Category on the Product Page

One of the simplest ways to hide the category is by using CSS. This method is easy to implement and won’t affect any other category displays in your shop, such as those on category pages or menus.

CSS Code to Hide Category Display

Add the following CSS to your theme’s style.css file or to the Additional CSS section in the WordPress Customiser:

/* Hide product category on single product page */
.single-product .product_meta .posted_in {
    display: none;
}

Explanation:

  • CSS Targeting: This CSS specifically targets the category line (.posted_in) on single product pages only.
  • Selective Hiding: The CSS will not hide categories in other areas, such as the shop or category archive pages, only on individual product pages.

Step 2: Use PHP to Remove the Category Programmatically (Optional)

If you want more control or if your theme does not use the default WooCommerce CSS classes, you can remove the category display using PHP. This method is also helpful if you plan to make other adjustments to product page metadata.

PHP Code to Remove Category from Product Pages

Add this code to your theme’s functions.php file or a child theme:

/*
 * Snippet: How to Hide Product Category on WooCommerce Product Pages – 2026
* Author: John Cook
* URL: https://wcsuccessacademy.com/?p=1703
* Tested with WooCommerce 10.7.0
* "This function removes the category display from the product page"
*/ function wcsuccess_remove_product_category() { remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 ); } add_action( 'wp', 'wcsuccess_remove_product_category' );

xplanation:

  • Remove Action: This code removes the entire metadata section (woocommerce_template_single_meta), which includes the category display from the product page.
  • Action Hook: The wp hook ensures this function only runs on the front end, avoiding any issues with WooCommerce in the admin area.
See also  How to Create Variable Virtual Downloadable Products Automatically When a New Image Is Uploaded - 2026

Step 3: Optional Customisation – Hiding Other Metadata

If your product page includes additional metadata, such as tags or SKU, you may want to selectively hide these as well. You can modify the CSS to hide only specific elements by targeting their classes.

CSS to Hide Additional Metadata

Here are some additional CSS rules you can add if you wish to hide tags or SKUs:

/* Hide product tags */
.single-product .product_meta .tagged_as {
    display: none;
}

/* Hide product SKU */
.single-product .product_meta .sku_wrapper {
    display: none;
}

Explanation:

  • Selective Metadata Hiding: These CSS rules allow you to hide specific elements like tags and SKU while leaving other metadata visible.
  • Customisable: Adjust these CSS rules as needed to control which metadata elements are shown or hidden on product pages.

Example Workflow

  1. CSS Customisation: Add CSS to hide the category display on individual product pages.
  2. PHP Adjustment (Optional): Use PHP to remove category and metadata for a cleaner product page.
  3. Additional Metadata Control: Optionally hide other metadata such as tags or SKU with additional CSS rules.
See also  How to Manage WooCommerce Cost of Goods Without a Plugin - 2026

Conclusion

Hiding the product category on WooCommerce product pages can create a simpler, more focused product page layout. By using either CSS or PHP, you can customise your WooCommerce product pages to better fit your design goals.

As always, test these changes in a staging environment before deploying to your live site. For more customisation options, explore our WooCommerce Visual Hooks Guide or our wp-config generator for advanced configurations.

0 0 votes
Article Rating

Stay In Touch

Was this post helpful? Why not show your support and buy me a coffee?

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Scroll to Top
0
Would love your thoughts, please comment.x
()
x
×