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
| Setting | Default | What it does |
|---|---|---|
| Show empty options | Off | When off, options with zero matching posts are hidden after counts update |
| Hide empty options on page load | Off | On first paint, hide zero-count options even if Show empty options is on |
| Display current terms only | Off | Limit options to terms attached to posts in the current result set |
| Hide filter when empty | On | Remove the entire filter item if no options would display |
These settings interact with Show count and the parent Filter Posts Update filter count option.
Recommended patterns
Standard shop sidebar (hide dead ends)
Best for most WooCommerce faceted layouts:
| Setting | Value |
|---|---|
| Show empty options | Off |
| Hide empty options on page load | Off |
| Hide filter when empty | On |
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:
| Setting | Value |
|---|---|
| Show empty options | On |
| Hide empty options on page load | On |
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:
| Setting | Value |
|---|---|
| Display current terms only | On |
| Show empty options | Off |
Common on large directories where showing every historical term is noisy.
How counts drive empty logic
- Visitor loads the page—initial counts come from the base query (Archive Loop include/exclude + post type).
- Visitor changes a filter—AJAX re-runs the query.
- Depending on Update filter count on Filter Posts, counts refresh on all items, all except the active item, or not at all.
- Options with count
0are hidden unless Show empty options is enabled.
Enable Show count on items when you want visible numbers beside each label (e.g. “Blue (4)”).
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
| Symptom | Check |
|---|---|
| All options disappear after one click | Display current terms only may be too aggressive; verify include/exclude on Archive Loop |
| Options never hide | Enable Show count; set Update filter count on Filter Posts; confirm Show empty options is off |
| Counts stuck after first load | Update filter count set to “Do not update any filter counts” |
| Category shows but attributes empty | Normal—parent category may have no products with that attribute; adjust Hide filter when empty |
More help: Empty options or counts troubleshooting.
Related settings
- Filter Posts Item → Count settings
- Filter Posts → Update filter count
- Common filter setups — Recipes with empty option defaults
What's next
- Filter sources and control types — Choose the right control for each source
- Catalog Index — Pro performance for large catalogs
- Common filter setups — Apply empty option defaults to real layouts