How to Hide a Product or an Entire Category in WooCommerce
Every store ends up with products it needs to keep in the system but doesn’t want visible to customers. Maybe it’s a seasonal item you don’t want to delete and rebuild every year. Maybe it’s a product you sell only through a direct link for a specific client. Maybe you’re testing a new listing before it goes live. Whatever the reason, WooCommerce gives you more than one way to handle this, and picking the right one matters more than people realize.
I’ve had to deal with this on a store carrying a large product catalog, and the mistake most people make is treating “hide” as one single setting when it’s really a handful of different options, each hiding the product from a different place. Here’s how to think about it properly.
First, Decide What “Hidden” Actually Means for You
Before touching any settings, it helps to answer one question: do you want the product gone from your store’s search and browsing, but still reachable by anyone with the direct link? Or do you want it completely invisible everywhere, including search engines?
This matters a lot for SEO. If a product page has been indexed by Google and picking up traffic, fully hiding it can mean losing that ranking and having to rebuild it later if the product comes back. If you just want it off the shop and category pages but still viewable and shareable by direct link, that’s a completely different setting than making it disappear entirely.
Option 1: Catalog Visibility (No Plugin Needed)
This is the setting most people are actually looking for, and it’s built into WooCommerce already, no extra plugin required.
On any product’s edit screen, find the “Catalog visibility” option, usually right under the short description box. Click it and you’ll see three choices:
- Shop and search results – the default, fully visible everywhere.
- Shop only – shows up when browsing categories, but won’t appear in on-site search.
- Search results only – won’t show up when browsing, but will appear if someone searches for it directly.
- Hidden – removes it from both the shop page and search results, but the product page itself still exists and works if someone has the direct URL.
For most “I want this off the shelves for now” situations, setting visibility to Hidden is exactly what you need. The product still exists, its URL still works, but nobody stumbles onto it while browsing or searching your store.
Option 2: Grouping Products Into a Hidden Category
If you have a batch of products you want to hide together, like an entire seasonal collection, it’s usually easier to manage this at the category level instead of clicking into each product one by one.
Here’s the approach:
- Create a new product category, something like “Seasonal” or “Archived.”
- Assign all the products you want hidden to that category.
- Add a small snippet to your theme’s
functions.phpfile (or better, a site-specific plugin so it survives theme updates) that excludes that category from your shop and category queries.
A basic version of that snippet looks like this:
add_action( 'pre_get_posts', 'hide_products_from_specific_category' );
function hide_products_from_specific_category( $query ) {
if ( ! is_admin() && $query->is_main_query() && ( is_shop() || is_product_category() ) ) {
$query->set( 'tax_query', array(
array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => 'seasonal',
'operator' => 'NOT IN',
),
) );
}
}
Just swap 'seasonal' for whatever category slug you actually used. This keeps every product in that category out of your main shop page and category archives, without touching the products individually.
One thing worth being careful about here: test this on a staging site first. Editing functions.php directly can break your whole site with a single typo, and there’s no undo button once the site goes down. If you’re not comfortable editing theme files, a child theme or a small custom plugin is the safer place to put this kind of code.
Option 3: Controlling Visibility in Search Specifically
Sometimes you don’t want a product removed from your shop page, but you do want more precise control, for example keeping it out of the catalog grid while still letting it show up if someone searches for it by name. This needs a slightly more targeted filter using WooCommerce’s visibility hook rather than the tax query approach above:
add_filter( 'woocommerce_product_is_visible', 'restrict_category_to_search_only', 10, 2 );
function restrict_category_to_search_only( $is_visible, $product_id ) {
if ( has_term( 'seasonal', 'product_cat', $product_id ) ) {
return is_search() ? true : false;
}
return $is_visible;
}
This tells WooCommerce to only treat products in that category as visible when the request is a search query, and hidden everywhere else. It’s a nice middle ground between fully hiding something and leaving it fully exposed.
Option 4: Plugins, If You’d Rather Skip the Code
If editing PHP files isn’t something you want to deal with, plugins like Catalog Visibility Options or similar tools add these same controls through a simple settings screen instead of code. This is worth it if you’re managing hidden products regularly and want a repeatable workflow without touching code every time, or if you’re not confident making direct file edits yourself.
For a one-time or occasional need, the built-in Catalog Visibility setting is usually enough and doesn’t add another plugin to your site. For ongoing, frequent hiding and unhiding across a large catalog, a dedicated plugin can save real time.
Don’t Forget the SEO Side
If a product page has already been indexed by Google and is bringing in organic traffic, fully hiding or unpublishing it can hurt more than help. In that case, consider:
- Keeping the visibility as “Hidden” rather than draft or private, so the page stays live and indexed but isn’t pushed on customers browsing the store.
- Adding a clear note on the page itself if it’s out of stock or out of season, rather than making the whole page vanish.
- Using a 301 redirect only if the product is genuinely gone for good and isn’t coming back.
Quick Recap
- WooCommerce’s built-in Catalog Visibility setting handles most simple “hide this product” needs without any code or plugin.
- Grouping products into a dedicated category and excluding that category via a small code snippet is the cleanest way to hide a batch of products at once.
- A visibility filter tied to
is_search()lets you fine-tune whether hidden products still show up in on-site search results. - Plugins are worth it if you’re managing this often and want a settings screen instead of code.
- Always think about SEO before fully hiding an indexed product page. Sometimes “hidden” is the better choice over “deleted” or “draft.”
Getting this right the first time saves you from having to rebuild product pages and lost rankings later, especially on a larger catalog where these things get easy to lose track of.
