Support » Plugin: WooCommerce » Products still show in search results even with Catalog Visibility set to Hidden

  • Resolved Jeff Sherk


    **Describe the bug**
    Product still shows up in search results even when catalog visibility is to to “shop only” or “hidden”.

    **To Reproduce**
    Create a Simple Product that is Virual and is also Downloadable called My Dogs.
    Set the catalog visibility to hidden.
    Publish the product.
    Search your site with
    The product will still show up on search results page (but is successfully hidden from shop page).
    NOTE: Setting catalog visibility to “search results only” will succesfully hide it from the Shop as well.

    **Expected behavior**
    When catalog visibility is set to “shop only” or “hidden” the product should NOT show up in any search results.

    **Isolating the problem (mark completed items with an [x]):**
    – [x] I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
    – [x] This bug happens with a default WordPress theme active, or [Storefront](
    – [x] I can reproduce this bug consistently using the steps above.

    **WordPress Environment**
    WordPress v5.3.2 and WooCommerce v3.9.1

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support John Coy a11n


    Automattic Happiness Engineer

    Hi @jsherk

    Products do not show up in search if they are hidden from the catalog.

    Typically issues like this are caused by a theme or plugin conflict. Try switching back to a default theme like Twenty Twenty and disabling all plugins except for WooCommerce to see if this resolves the issue. Here is a link that better outlines that process:

    If this fixes the issue, then re-enable each plugin one at a time, then the theme, until you find the one that’s causing the conflict.

    Plugin Support John Coy a11n


    Automattic Happiness Engineer

    Hello @jsherk

    We haven’t heard back and will resolve this ticket. Should you still have questions or problems, please create a new thread and we’ll be happy to help further.


    Thread Starter Jeff Sherk


    I have posted this bug on github:

    There are others reporting the same issue.

    @johndcoy it is WooCommerce’s bug it happen on all themes.

    Hello! Is it solved?
    I’m also facing the same issue!
    I’ve enabled all the necessary options in WooCommerce-> Product Visibility by Country Options. But still, the product shows on search!!

    Hi, I had the same issue. ‘hidden’ products would be hidden from the product search but not from general site search. I added a product category called “hide-from-search” and added the following action hook to functions.php.

    This excludes any product in that category from the search results. You still need to hide the product to remove it from up-sell/cross-sell etc.

    function exclude_product_category_from_search ( $query ) {
        global $wp_the_query;
        if($query === $wp_the_query && $query->is_search() && !is_admin()) {
            $tax_query = array(
                    'taxonomy' => 'product_cat',
                    'field' => 'slug',
                    'terms' => 'hide-from-search',
                    'operator' => 'NOT IN',
            $query->set( 'tax_query', $tax_query );

    This is adapted from this post:

    Hope it helps.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Products still show in search results even with Catalog Visibility set to Hidden’ is closed to new replies.