October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk11 min

How to Add a Product Filter to WooCommerce (Blocks, Extension, Shortcodes, and Code)

A practical guide to adding WooCommerce product filters with the Product Collection block, the official Product Filters extension, shortcode pages, and Store API or block development.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The simplest current method is to edit your WooCommerce product-archive template and configure its Product Collection block. Enable the controls your catalog actually supports—categories, attributes such as size or color, price range, stock status, sale status, or ratings—and publish the template. For richer filtering, use the official WooCommerce Product Filters extension. Use a shortcode layout only when you deliberately build a shortcode-based catalog page, and use block extensibility or the Store API when the required query logic cannot be expressed in the editor.

Choose the right WooCommerce filtering method

WooCommerce filtering is not one feature with one setup screen. The correct implementation depends on your theme, the type of product data you maintain, how much control shoppers need, and whether filtered results should have shareable or indexable URLs.

As an Amazon Associate I earn from qualifying purchases.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Approach Setup surface Filter depth Theme compatibility Result updates URL and SEO control Maintenance burden
Product Collection block Site Editor template Core catalog controls such as price, categories, tags, attributes, sale, featured, keywords, stock, and created date Best fit for block themes and block-based product archives Controlled by the block’s catalog interface Basic template-level control; advanced indexation rules are limited Lowest
WooCommerce Product Filters extension Extension settings and filter blocks or shortcodes, depending on the layout Attributes, categories, tags, brands, custom taxonomies, price, stock, sale, and rating filters Use according to the extension’s documented integration method Products update without a full page reload Clean filtered URLs plus indexation and sitemap controls Moderate
Filter and products shortcodes Shortcode-based page or classic editor content Depends on the extension’s configured filters Useful for shortcode layouts; not interchangeable with every block product grid Depends on the extension and page configuration Depends on the extension configuration and page architecture Moderate
Block extensibility or Store API code Developer implementation Custom query attributes, business rules, and interface behavior Can be integrated with a block-based storefront when developed correctly Must be implemented and tested Can be designed precisely, but developers must handle canonical, indexation, and caching behavior Highest

Start with the Product Collection block unless you have a specific requirement that it cannot meet. Adding an extension or custom code before your product data and archive template are ready creates more places for filters to disagree with the catalog.

Prepare product data before adding controls

A filter can only return reliable results when the underlying products use consistent values. Decide which product property answers each shopper question, then use that property everywhere in the catalog.

Use categories for broad product groups

Categories should describe durable catalog groupings such as “Men’s shoes,” “Coffee equipment,” or “Office chairs.” Keep them broad enough that a shopper can understand the result set. Do not create a new category for every color or minor variation when an attribute is the better fit.

Use global attributes for specifications

Global attributes are appropriate for values such as size, color, material, screen size, or compatibility. Reuse the same attribute and term spelling across products. For example, use one global “Color” attribute with terms such as “Black,” “White,” and “Blue,” rather than separate custom fields that look identical but cannot be queried together.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Maintain price and stock values

Price-range filters require usable product prices, including variation pricing where applicable. Stock filters require accurate inventory status. WooCommerce query fields recognize values including instock, outofstock, and onbackorder. If inventory is not maintained, hiding unavailable items with a filter does not solve the underlying catalog problem.

Decide which states deserve a filter

  • On sale: useful when promotions are a regular shopping path.
  • Featured: useful for curated merchandising, not as a substitute for categories.
  • Rating: useful only when enough products have meaningful reviews.
  • Created date: useful for catalogs where new arrivals matter.
  • Tags: useful for cross-category themes, but avoid uncontrolled tag growth.

Before publishing, open several products and verify that the values you intend to expose are actually assigned. Empty or nearly empty filter terms make the interface look broken even when the code is working.

Add filters with the Product Collection block

The Product Collection block is WooCommerce’s core product-display block for catalog, category, tag, attribute, brand, and search templates. In a block theme, configure the block in the template that controls the page where shoppers need the filter.

1. Open the correct product-archive template

  1. In WordPress, go to Appearance → Editor.
  2. Open Templates and select the archive you need to change, such as the shop, product category, product tag, product attribute, brand, or search template.
  3. Choose Edit and locate the Product Collection block. If the template uses another product-grid block, replace or reconfigure it so the collection and its controls are in the same archive structure.

2. Select the Product Collection block

Click the collection rather than an individual product inside the grid. The block’s settings apply to the query and catalog display. If you cannot select a Product Collection block, check whether the template is supplied by a classic theme or a third-party builder; the editor path may differ.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Turn on the relevant filter controls

Use the block settings to expose only controls that match your data. A practical mapping is:

Shopper need Control to expose Required catalog data
Find a broad product type Categories Consistent product categories
Choose a specification Product attributes Global attributes and assigned terms, such as size or color
Stay within a budget Price range Correct regular and sale prices
See available items Stock status Updated inventory states
Find promotions On-sale status Products with sale prices or sale status
Browse curated items Featured or hand-picked products Products marked or selected for merchandising
Search by wording Keywords Product names, descriptions, and searchable content
Find recent additions Created date Accurate product publication dates

4. Configure the collection query when needed

A custom collection can be constrained by conditions such as sale status and stock status. Use these constraints when a page has a fixed purpose—for example, a sale archive—rather than asking shoppers to reproduce the same condition manually every time.

The developer reference for the collection query includes fields for product attributes, stock status, price range, hand-picked products, and layout. Stock values include instock, outofstock, and onbackorder. If the editor does not expose the combination you need, that is the point at which block extensibility or the Store API becomes relevant.

5. Save and test each archive type

  1. Click Save in the Site Editor.
  2. Open the shop page in a logged-out browser window or private window.
  3. Test one category, one attribute term, a price boundary, and each stock state you intend to show.
  4. Repeat the test on a category, tag, attribute, brand, and search archive if those templates use separate collections.
  5. Check the mobile layout and confirm that the filter controls do not push the product grid below an unusable amount of content.

Do not assume that changing the shop template changes every archive. WooCommerce can use different templates for different product-query contexts, and a filter visible on one archive may be absent from another.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the WooCommerce Product Filters extension for richer controls

Choose the official WooCommerce Product Filters extension when the core collection controls are not deep enough for your catalog. Its documented filter types include attributes, categories, tags, brands, custom taxonomies, price, stock status, sale status, and rating.

What the extension adds

  • More taxonomies: expose brands and custom taxonomies alongside standard WooCommerce data.
  • Rating filtering: show star levels that have matching products rather than presenting empty choices.
  • Stock and sale behavior: expose in-stock, out-of-stock, and back-order choices when products with those states exist.
  • Live result updates: products update without a full page reload, reducing the friction of trying several combinations.
  • URL controls: use clean filtered URLs and configure indexation and sitemap behavior.

Understand how combined selections work

Within one filter, selected values are combined with OR. Selecting “Black” and “Blue” in the same color filter therefore matches products with either value. Different filters are combined with AND. Selecting “Black” plus “Large” returns products that satisfy both conditions. This behavior should be reflected in the labels and help text of a densely filtered catalog.

Configure filter visibility and empty states

Do not expose every available taxonomy merely because the extension supports it. Give shoppers a short path to a useful result. Hide filters that have no matching values in the current catalog context, and check how the interface behaves after a selection removes all products. A clear “no products found” state should offer a way to clear filters rather than leaving the shopper at a dead end.

Make an SEO decision before enabling indexation

Filtered combinations can create many URLs. Index only combinations that have stable, useful landing-page content and a reason for search visitors to arrive there. Leave exploratory combinations out of indexation when they add no unique value. Configure sitemap inclusion consistently with the indexation choice; a URL should not be promoted in a sitemap while being deliberately excluded from search indexing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build a shortcode-based filter page

Shortcodes are useful when you intentionally create a catalog page outside the standard block-template flow. The documented pattern places the filter shortcode and the products shortcode on the same page and gives both the same filter ID. Sorting can be enabled on the products shortcode.

  1. Create or edit the catalog page in the editor supported by your site.
  2. Insert the extension’s filter shortcode and set a filter ID.
  3. Insert the products shortcode below it and use the identical filter ID.
  4. Enable sorting on the products shortcode if shoppers need to reorder results.
  5. Publish the page and test category, attribute, price, stock, and reset behavior.

The filter shortcode is not supported inside WooCommerce Blocks’ Products block. A shortcode filter therefore should not be expected to control a separate block-based product grid. Keep the filter and product output in the shortcode architecture the extension documents, or use the Product Collection route instead.

When a shortcode page is the better fit

  • You need a dedicated landing page with a deliberately arranged filter and product output.
  • Your theme is classic or your page builder already relies on shortcodes.
  • You want to keep a custom catalog page separate from the default shop template.

If the site is otherwise block-based, mixing a shortcode filter with an unrelated block product grid is a common source of “the filter appears but does nothing” reports.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Extend the Store API or blocks when the editor is not enough

Custom development is justified when the business rule cannot be represented by the core collection controls or the extension. Examples include a compound compatibility rule, a calculated availability state, or a custom taxonomy relationship that must be queried alongside price and stock.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use documented query fields first

The WooCommerce developer documentation exposes query attributes for product attributes, stock status, price range, hand-picked products, and layout. It also identifies controls that can be hidden or customized. Review those supported fields before writing a new query layer; a supported attribute is easier to maintain through WooCommerce updates than a private implementation detail.

Define the custom contract

Before coding, write down the input, output, and interaction rules:

  • Which URL parameters or block controls represent each filter?
  • Are values within one filter ORed and separate filters ANDed?
  • What happens when a combination returns no products?
  • Should the URL be shareable, canonicalized, indexed, or excluded from sitemaps?
  • How will caching vary by filter state?
  • Which user roles, currencies, stock rules, and product types must be supported?

Implementing only the visible controls without these rules can produce inconsistent counts, cache errors, or URLs that show a different result after a refresh.

Test Store API integrations like a product feature

Test simple products, variable products, sale items, back-orders, out-of-stock items, and products with multiple attribute terms. Also test direct visits to a filtered URL, browser back and forward navigation, clearing one filter while retaining others, and a zero-result combination. A custom filter is part of the storefront’s query and caching system, not merely a visual widget.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Fix common WooCommerce filter problems

The filter is visible but returns no products

  • Open a product that should match and verify the exact category, attribute term, price, or stock state.
  • Check spelling and term duplication. “Blue” and “blue” can become separate values in poorly maintained catalogs.
  • For variations, confirm that the attribute is assigned to the variation and not only written in the parent description.
  • Clear other active filters; AND logic across different filters can legitimately produce zero results.

A stock option is missing

The interface may show only stock values that have matching products. Confirm that products actually use the intended state, including instock, outofstock, or onbackorder, and that inventory management is enabled where required.

Price filtering behaves unexpectedly

Check regular and sale prices, variation ranges, tax display settings, and currency configuration. A shopper’s displayed price may include tax or a sale value while the query is evaluating stored product prices. Test the lowest and highest boundaries with products whose prices are known.

The shortcode filter does not control the product grid

Confirm that the filter and products shortcodes use the same filter ID and that the product output is also shortcode-based. The documented shortcode limitation means a filter shortcode cannot be assumed to control WooCommerce Blocks’ Products block.

Filters work in the editor but not on the live site

Save the template, clear page and object caches, and test while logged out. Check whether a theme or page builder replaces the archive template on the front end. If a custom script or optimization layer delays or removes the filter’s JavaScript, temporarily disable that optimization and retest before changing the query.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Filtered URLs create duplicate or thin pages

Review the extension’s URL, indexation, and sitemap settings. Keep exploratory combinations out of search indexing unless they have useful, stable content. Also check canonical behavior and ensure that a cache does not serve one filter state to another visitor.

Recommended rollout checklist

  1. Inventory the product questions shoppers actually ask: category, size, color, price, stock, sale, rating, brand, or another taxonomy.
  2. Normalize product categories, global attributes, prices, and stock states before exposing them.
  3. Configure the Product Collection block on each relevant archive template.
  4. Use the extension only when you need its additional taxonomies, ratings, live updates, or URL controls.
  5. Use shortcodes for a deliberately shortcode-based page, keeping the filter and products output tied to the same filter ID.
  6. Use block extensibility or the Store API for rules that supported editor and extension controls cannot express.
  7. Test combinations, zero results, reset behavior, direct filtered URLs, mobile layout, caching, and logged-out browsing.
  8. Decide which filtered URLs, if any, deserve indexation and sitemap inclusion.

Which approach should you choose?

For a normal block-theme store, choose the Product Collection block first. It is the shortest path to category, attribute, price, stock, sale, keyword, featured, tag, and date controls in the product archives. Choose the official Product Filters extension when shoppers need brands, custom taxonomies, ratings, richer stock and sale behavior, no-reload updates, or deliberate filtered-URL management. Choose shortcodes only for a page designed around shortcode output, and choose custom development when the required query or interaction is genuinely beyond those interfaces.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

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

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.