Skip to content

How to Hide Private Products from Your WooCommerce Store

Flat locked product box with hidden eye icon beside the title How to Hide Private Products in WooCommerce

Knowing how to hide private products from your WooCommerce store is something most store owners figure out the hard way. You set a product to Private, assume it is hidden and then discover it still shows up in the shop with Private slapped in front of the title. Not exactly the clean online store you had in mind.

WooCommerce gives you several ways to control product visibility, but each one works differently. Some block the shop page. Some block search results. Some do neither but feel like they should. Picking the wrong method means your private products stay visible to customers, or worse, to Google.

This guide covers five methods for hiding private products, from the built-in visibility settings to a PHP snippet and role-based plugins. We checked each one against the WooCommerce product editor docs and the WordPress content visibility docs in October 2026. By the end, you will know which method fits your store and how to set it up.

What Does Hiding a Product Mean in WooCommerce?

Draft Private and Hidden WooCommerce product states compared by who sees them and where

Hiding a product in WooCommerce means one of three things: Draft, Private or Hidden catalog visibility. Each one blocks a different mix of the shop page, search results and the product’s own URL. Picking Hidden when you meant Private is the easiest mistake to make here.

  • Draft: The product is off the storefront entirely. Nobody can view it, buy it or find it. Use this when a product is not ready yet and should not show anywhere on the frontend.
  • Private: A WordPress post status. Only admins and shop managers can see the product, and guests who open its URL get a 404 page. The catch is that logged-in admins still see private products on the shop and category pages with Private in front of the title.
  • Hidden catalog visibility: A WooCommerce setting that removes the product from shop pages and search results. The product page still works from a direct URL. Anyone with the link can view and buy it.

How to Hide Private Products from Your WooCommerce Store: 5 Methods

You can hide private products in WooCommerce with a status change, a catalog setting, a short PHP snippet or a plugin. Methods 1 and 2 take under a minute and need no code. Use the table in the next section if you are not sure which one fits your goal.

Method 1: Set Product Status to Private

This is the fastest no-code option for keeping a product out of public view while keeping it available for backend use, manual billing, or admin use.

  1. Go to Products > All Products in your WordPress dashboard.
    All Products item highlighted in the Products menu of the WordPress dashboard
  2. Click Edit on the product you want to hide.
    Edit link in the row actions of a product in the WooCommerce products list
  3. In the Publish box on the right side, find the Visibility option and click Edit next to it.
    Visibility setting with its Edit link in the WooCommerce product Publish box
  4. Select Private.
    Private option selected in the product visibility settings
  5. Click OK and then click Update to save.
    Update button in the Publish box after setting the product visibility to Private

The product will no longer appear on shop pages or in search results for guests and regular customers. Its direct URL returns a 404 page for them too. Admins and shop managers can still see it in the backend, and they will see it on the frontend too if they are logged in. That is the known limitation of this method. Method 3 below fixes it.

For a variable product, set the status on the parent product. Each variation also has its own Enabled checkbox in the Variations tab. Unchecking it turns off one variation without hiding the rest.

Method 2: Set Catalog Visibility to Hidden

Use this when you want a product active and purchasable via direct link, just not easy to find through shop browsing or search.

  1. In the Publish box, click Edit next to Catalog visibility.
    Edit link next to Catalog visibility in the product Publish box
  2. Select Hidden.
    Hidden option selected in the catalog visibility settings
  3. Click OK and then Update to save.
    Update button in the Publish box after setting catalog visibility to Hidden

The product disappears from the shop page and WooCommerce search results. The WooCommerce product editor docs describe a Hidden product as visible only on its single product page. The direct product URL still works. Someone with the link can view the product, add it to the cart, and buy it without any difficulty.

This method suits products you share through a private link, like a wholesale-only SKU or a special bundle for a specific client. Do not use it if full privacy is the goal. The direct URL remains open to anyone who has it or guesses it.

WooCommerce catalog visibility settings affect the WooCommerce product loop. They do not control the WordPress default search or external search plugins. If you have SearchWP or ElasticPress installed, test whether hidden products still appear there.

Method 3: Hide Private Products from Admin View Using PHP

You have set products to Private, but when you are logged in as an admin and browse your own shop, you can still see them with Private in the title. This is default WordPress behavior. Admins and editors are allowed to read private posts, and WordPress treats a WordPress private page the same way for those users. It is not a bug, but it makes the frontend look messy and does not show what customers see.

The fix is a single code snippet added to your child theme’s functions.php file.

  1. Go to Appearance > Theme File Editor or Tools > Theme File Editor on a block theme.
    Theme File Editor item in the Tools menu of the WordPress dashboard
  2. Select your child theme from the dropdown and open functions.php.
    Child theme selected in the Theme File Editor with functions.php open
  3. Add the following code at the end of the file:
/**
 * Hide private products from the shop, product category and product search pages,
 * including for logged-in admins and shop managers.
 * Single product pages and the admin area are not changed.
 */
add_action( 'pre_get_posts', 'devdiggers_hide_private_products_frontend', 20 );

function devdiggers_hide_private_products_frontend( $query ) {
    if ( is_admin() || ! $query->is_main_query() ) {
        return;
    }

    $is_product_archive = $query->is_post_type_archive( 'product' )
        || $query->is_tax( get_object_taxonomies( 'product' ) );
    $is_product_search  = $query->is_search() && 'product' === $query->get( 'post_type' );

    if ( $is_product_archive || $is_product_search ) {
        $query->set( 'post_status', 'publish' );
    }
}
  1. Update the file.
    Update File button below the code editor after the snippet is added to functions.php

After saving, refresh your shop page while logged in as admin. Private products should no longer appear.

The snippet uses the pre_get_posts hook and changes only the main query on product archives and product search. Those queries return published products only. Private pages and posts elsewhere on the site stay visible to admins, and the admin area is not touched.

Product grids from page builders and search plugins run their own queries. This snippet does not reach them. Check those blocks separately while logged in as an admin.

Always place custom code in a child theme and not your parent theme. If you update the parent theme, the code gets overwritten.

Method 4: Hide Products by User Role (Free Plugin)

For B2B stores, wholesale operations, or any store where product visibility depends on customer type, role-based control is the right approach. You want Customer A to see the full catalog. Customer B (say, a registered wholesale buyer) sees a different set. Guest visitors see only what you want them to see.

The free Product Visibility by User Role for WooCommerce plugin from WordPress.org handles this without any code. As of October 2026, WordPress.org lists version 1.8.5, updated in September 2026 and tested up to WordPress 7.1.3. If you only need to hide prices and keep products visible, compare the best WooCommerce hide price plugins.

  1. Go to Plugins > Add Plugin.
    Add Plugin item in the Plugins menu of the WordPress dashboard
  2. Then, search for Product Visibility by User Role for WooCommerce.
    Search Plugins field with Product Visibility by User Role typed in
  3. Install and activate the plugin.
    Install Now button on the Product Visibility by User Role for WooCommerce plugin card
  4. Choose the user roles that should not see this product from the product visibility panel.
    Invisible field in the Product visibility panel with the Guest and Customer roles chosen
  5. Update the product.
    Update button in the Publish box on the WooCommerce product edit screen

The plugin gives you three ways to hide a product from the restricted roles. It can hide the product from the shop and search results, make it non-purchasable or hide it completely.

The free version sets roles one product at a time. The Pro version sets them in bulk for many products, categories or tags.

Check your homepage sliders and recent product widgets after setting up role-based hiding. Some page builder widgets and custom shortcodes run their own product queries, and those can skip role filters. Our WooCommerce shortcodes guide lists the attributes each product shortcode accepts.

Method 5: Use a Plugin for Flexible Visibility Control

Use a Plugin for Flexible Visibility Control

If your store is growing and you are managing private products alongside pricing access rules, a plugin approach gives you more control than code alone.

Say a store wants to hide the price from guests as well as the product listing. A guest visiting a product URL should not see the price or the Add to Cart button. This is a step beyond visibility control and into access control.

For that use case, the WooCommerce Hide Price For Guest plugin built by DevDiggers covers that case. It hides prices and the add to cart button from visitors who are not logged in and shows your own message in their place. Rules let you limit it to specific products, categories or product types.

For a private catalog, you can pair Method 3 or Method 4 with a price-hiding layer. Visibility removes the product from browse and search. Price control protects the details if someone lands on the URL directly.

Need visibility rules that ready-made plugins do not offer? The WooCommerce development services at DevDiggers cover role-based access logic and custom product gating.

Which Method Should You Use?

Use Draft for products that are not ready and Private for products only staff should reach. Use Hidden catalog visibility when buyers need a direct link that still works. Pick a role-based plugin when different customer groups should see different products.

MethodBest ForBlocks Shop PageBlocks SearchBlocks Direct URLRequires LoginSetup TimePlugin Needed
DraftTemporarily hiding a product during editingYesYesYesNoUnder 1 minNo
Private StatusHiding from guests but keeping visible to adminsYes (guests only)YesYes (404 for guests)NoUnder 1 minNo
Catalog Visibility: HiddenHiding from shop/search but keeping URL accessibleYesYesNoNoUnder 1 minNo
PHP Snippet (admin fix)Hiding private products from admins on shop pagesYes (for admins)YesNoNo~5 minsNo
Role-Based Plugin (Free)Showing different products to retail vs wholesaleYes (by role)Yes (by role)Depends on the pluginYes Low to mediumYes (free)
Role-Based Plugin (Pro)Bulk rules by product, category or tagYes (by role)Yes (by role)Depends on the pluginYes MediumYes (paid)

Common Mistakes When Hiding WooCommerce Products

The mistakes below all leave a product reachable when the owner thought it was hidden. The usual causes are a direct URL that still works and search plugins that run their own queries. Test every change in a private browser window where you are logged out.

  1. Thinking Hidden means blocked: Setting catalog visibility to Hidden removes the product from shop pages and search, but the product URL stays live. If you share that URL anywhere, customers can still access it. For full blocking, use Private status or Draft.
  2. Forgetting product variations: A variation follows its parent product, and each variation also has its own Enabled checkbox in the Variations tab. After hiding a variable product, open its URL in a logged-out browser window to confirm guests cannot reach it.
  3. Using Draft when you mean Private: Draft products do not show up when you search for products to add to a manual order. If you want to keep a product available for manual orders or admin use while hiding it from public view, Draft is the wrong choice. Private is the right one.
  4. Not checking third-party search plugins: WooCommerce’s catalog visibility controls the native WooCommerce product query. Plugins like SearchWP, Relevanssi and Doofinder run separate queries. A product set to Hidden in WooCommerce may still appear in results from those plugins. Test search after changing visibility.
  5. Applying changes to the wrong environment: Changes made on a staging site do not carry over to production automatically. If you tested a visibility rule on staging and then pushed only theme files, the product-level visibility settings are still in the database and did not move with the deployment.

Does Hiding a Product Affect SEO?

Hiding a product affects SEO in different ways depending on the method. Private and Draft products return a 404 page to Google and drop out of the index over time. Hidden catalog visibility leaves the product page open to crawlers, and Google can keep it indexed.

  • Private status: Guests and search engines get a 404 page from the product URL. A product that used to be indexed drops out of Google as it crawls the URL again. Add a 301 redirect if the page had rankings worth keeping.
  • Hidden catalog visibility: The product URL stays open and crawlable. Google can index it. If that product should not appear in search results, set it to noindex in Rank Math or Yoast.
  • Draft status: The product URL returns a 404 page. Existing Google index entries drop as Google crawls the URL again.

Tip: If you are hiding products that were previously ranked or getting organic traffic, set up a 301 redirect from the old product URL to a relevant category page before removing them from the sitemap. This preserves any link value that the product page had gained.

For a broader look at how to protect your store’s content and organic visibility, the WooCommerce SEO guide covers product page optimization, sitemap control and technical SEO in detail.

If you are concerned about competitors or content copy tools accessing your product data through direct URLs, the guide on how to prevent content scraping on your WordPress site covers that angle separately. Visibility settings alone do not protect against scraping.

Conclusion

You can hide private products from your WooCommerce store without a complex setup. For most stores, Method 1 or Method 2 handles basic visibility in under a minute. If you are logged in as admin and seeing your own private products on the frontend, the PHP snippet in Method 3 solves that in five minutes. B2B and wholesale stores managing different product views per customer type will get the most out of Method 4.

Hidden catalog visibility does not block direct URL access. If full privacy matters, use Private or Draft. Add a noindex tag to any Hidden product that should stay out of Google.

For stores that need to control both product visibility and pricing access for guests, combining these methods with a dedicated tool like the WooCommerce Hide Price plugin gives you full control without touching much code.

Review your WooCommerce security checklist while you are at it. Visibility controls are one layer of store management. Security settings are another, and they often work together in ways that are worth checking.

Frequently Asked Questions (FAQs)

Q1. Can I hide a WooCommerce product without deleting it?

Yes. Setting a product to Private or changing its catalog visibility to Hidden keeps it in your database and usable for backend operations. It disappears from shop pages and search results without being deleted.

Q2. Why can I still see my private WooCommerce products when I am logged in?

WordPress shows private posts to administrators and shop managers by default. This is intended behavior. The PHP snippet in Method 3 removes private products from the shop, category and product search pages for every user, including admins.

Q3. Does hiding a product stop Google from indexing it?

Private and Draft products return a 404 page to visitors and search engines. Google drops them from its index over time. Hidden catalog visibility does not add a noindex tag. Set that page to noindex in Yoast or Rank Math if it should stay out of Google.

Q4. How can I restrict WooCommerce products based on user roles?

Use a role-based visibility plugin. The free Product Visibility by User Role for WooCommerce plugin lets you restrict products by WordPress user role. For more detailed control at the individual customer level, a custom development approach is usually needed.

Q5. Will hiding a product affect its sales data or order history?

No. Visibility settings only control whether the product appears in frontend browsing. Past orders, sales reports, and stock data are stored in the database independently and are not affected by visibility changes.

Rishi Yadav
Rishi Yadav

Rishi Yadav is a content writer at DevDiggers who covers WooCommerce store management, WordPress performance and security. He works through each topic in a test environment before writing about it. His guides focus on the steps and settings that matter and skip the ones that sound good on paper.

Leave a Reply

Your email address will not be published. Required fields are marked *