Skip to main content

Empty Filter Options

Faceted filters feel broken when visitors click options that return zero results. WPEnhanced Ajax Filter Blocks gives you fine-grained control over whether—and when—empty choices appear.

Empty option behaviour is configured per Filter Posts Item under the Empty options panel. It applies to select, checkbox/radio, and similar option-based controls—not search fields or range sliders.

The four settings​

SettingDefaultWhat it does
Show empty optionsOffWhen off, options with zero matching posts are hidden after counts update
Hide empty options on page loadOffOn first paint, hide zero-count options even if Show empty options is on
Display current terms onlyOffLimit options to terms attached to posts in the current result set
Hide filter when emptyOnRemove the entire filter item if no options would display

These settings interact with Show count and the parent Filter Posts Update filter count option.

Standard shop sidebar (hide dead ends)​

Best for most WooCommerce faceted layouts:

SettingValue
Show empty optionsOff
Hide empty options on page loadOff
Hide filter when emptyOn

Visitors only see attributes and categories that still yield products. Counts update after each filter change when Update filter count is enabled on Filter Posts.

Show all options initially, then narrow​

Useful when you want visitors to see the full catalog structure before filtering:

SettingValue
Show empty optionsOn
Hide empty options on page loadOn

On first load every term appears. After the visitor selects a category, zero-result attributes disappear.

Strict dynamic facets​

Maximum relevance—only terms present in current results:

SettingValue
Display current terms onlyOn
Show empty optionsOff

Common on large directories where showing every historical term is noisy.

How counts drive empty logic​

  1. Visitor loads the page—initial counts come from the base query (Archive Loop include/exclude + post type).
  2. Visitor changes a filter—AJAX re-runs the query.
  3. Depending on Update filter count on Filter Posts, counts refresh on all items, all except the active item, or not at all.
  4. Options with count 0 are hidden unless Show empty options is enabled.

Enable Show count on items when you want visible numbers beside each label (e.g. “Blue (4)”).

note

On very large WooCommerce catalogs, count calculation can be slow. Catalog Index (Pro) pre-indexes options for faster count updates.

Hide filter when empty​

When every option in an item would be hidden, Hide filter when empty removes the whole field—including its label—so you do not show an empty “Size” box with no choices.

Turn this off if you prefer to show a disabled filter with a message for accessibility or layout consistency.

Stock and WooCommerce interactions​

Out-of-stock products affect counts depending on Stock visibility mode on Filter Posts (inherit global setting or override). If out-of-stock products are excluded from queries, their attributes may disappear from facet lists sooner.

Troubleshooting empty options​

SymptomCheck
All options disappear after one clickDisplay current terms only may be too aggressive; verify include/exclude on Archive Loop
Options never hideEnable Show count; set Update filter count on Filter Posts; confirm Show empty options is off
Counts stuck after first loadUpdate filter count set to “Do not update any filter counts”
Category shows but attributes emptyNormal—parent category may have no products with that attribute; adjust Hide filter when empty

More help: Empty options or counts troubleshooting.

What's next​