---
title: "How to Search WooCommerce Products by Category in WordPress?"
url: https://nexterwp.com/docs/search-woocommerce-products-by-category-in-wordpress/
date: 2024-12-02
modified: 2026-09-22
lang: en
author: "Aditya Sharma"
description: "A store with a few hundred products needs more than a text box. Letting a shopper pick the category first turns a vague search into a specific one. The Search..."
image: https://nexterwp.com/wp-content/uploads/2024/12/How-to-Search-WooCommerce-Products-by-Category-in-WordPress_-1024x519.jpg
word_count: 410
---

# How to Search WooCommerce Products by Category in WordPress?

## Key Takeaways

- Nexter Blocks Search Bar block lets WordPress users search WooCommerce products by category after selecting Taxonomy in Source and Product categories in the Select Taxonomy dropdown.
- Search Bar block adds a dropdown beside the search bar, with Label and Placeholder fields plus All Result and Show Count toggles.
- AJAX Search in the Extra Option tab lets shoppers select a product category from the dropdown or search for products within that category.

A store with a few hundred products needs more than a text box. Letting a shopper pick the category first turns a vague search into a specific one.

The Search Bar builds the dropdown from your real product categories.

*For every Search Bar setting in one place, see the [Search Bar guide](https://nexterwp.com/docs/add-a-search-bar-in-wordpress/).*

[LIVE BLOCK LINK](https://nexterwp.com/nexter-blocks/builder/wordpress-ajax-search-bar/)

## Before You Start

- **Edition:** Free. Measured with Nexter Blocks Pro deactivated, the Search Bar renders identically — form, input, dropdowns, suggestions and results all work without Pro.- **Block to enable:** Search Bar, switched on under **Nexter > Blocks** in your WordPress dashboard.- **WooCommerce active, with published products.** Product search is guarded: with WooCommerce inactive the block returns an error rather than an empty list.- **Products assigned to product categories.** The dropdown is built from those terms.

## Steps

- Select your **Search Bar** block and add a **filter field** with **taxonomy** as its source.

![Adding a taxonomy filter field](https://nexterwp.com/wp-content/uploads/2024/12/searchbar-taxonomy-product-category.png)

- Choose **Product Category** as the taxonomy, then publish.

![Choosing the product category taxonomy](https://nexterwp.com/wp-content/uploads/2024/12/searchbar-ajax-search-6.png)

## How It Behaves

- **The dropdown is built from your live product categories.** Measured on a store with five, the dropdown rendered 6 options including the All entry.- **Choosing a category filters the query exactly.** Measured: selecting the Prints category returned exactly 6 products, matching that category's real contents.- **The post type is derived from the taxonomy**, so choosing product category is enough to make it a product search — you do not also need a post type filter.- **Hidden products stay hidden**, because the catalogue visibility exclusion still applies.- **Prices render on the cards** once the price toggle is on, using WooCommerce's own markup.

## Limitations

- **Only top-level product categories are listed** unless sub-categories are enabled, and sub-term indenting is only implemented for the built-in category taxonomy.- **Empty categories still appear** and return nothing when chosen.- **One category at a time.** There is no multi-select.- **The category narrows, it does not search.** The typed term still has to match an enabled field, which by default is the product title only.

## Troubleshooting

### The dropdown is empty

No product categories exist, or the taxonomy was not selected on the filter field.

### Choosing a category returns nothing

Either nothing is assigned to it, or the typed term does not match the titles of the products that are.

### It is returning blog posts as well

That happens when a separate post type filter is also present and set wider. Remove it and let the taxonomy decide.

## Related Docs

- [Only search WooCommerce products](https://nexterwp.com/docs/only-search-woocommerce-products-in-wordpress/)- [Search WooCommerce products by tag](https://nexterwp.com/docs/search-woocommerce-products-by-tag-in-wordpress/)- [Add AJAX search for WooCommerce products](https://nexterwp.com/docs/add-ajax-search-for-woocommerce-products-in-wordpress/)- [Limit search by a taxonomy term](https://nexterwp.com/docs/limit-wordpress-search-by-a-taxonomy-term/)- [Add product listing in WordPress](https://nexterwp.com/docs/add-product-listing-in-wordpress/)