Skip to main content

Empty Filter Options

Divi 5 only

This feature guide assumes Divi 5 (Filter Posts in the Visual Builder). On Divi 4, related options exist in the classic module UI—see Divi 4 modules and the FAQ.

Overview

The Empty Filter Options feature controls how the Filter Posts module handles filter options that have zero results. Instead of showing every possible filter option (which might display "Category (0)" or similar), you can configure filters to intelligently hide or show options based on:

  • Whether options have any associated posts or products

  • The current filtering context (what other filters are active)

  • The initial page load state

  • The current archive or category page

This creates smart, context-aware filtering experiences where users only see relevant options that will actually return results.

Filter options dynamically hiding and showing based on availability

Why this matters

Empty filter options improve user experience by preventing "dead ends" where users select a filter combination that returns zero results. It keeps filtering interfaces clean and helps users discover what's actually available.


Prerequisites

Before configuring empty filter options, ensure:

  • Filter Update Type is set to "On Change" in the Filter Posts module Main Settings

  • Display Filter Count is enabled (the plugin needs counts to determine what's empty)

    • You can hide counts visually with CSS if needed while keeping functionality
Required setting

Empty filter options require the "On Change" update method to work properly. If set to "On Button Click," dynamic hiding/showing of options will not function.


How It Works

Empty filter options work at two levels:

Module Level

Controls how the FIRST filter clicked behaves and affects other filters.

Filter Item Level

Controls each individual filter's empty option behavior.

The combination of these settings creates different user experiences, from showing all options always, to aggressive hiding of anything unavailable, to context-aware filtering that adapts to the current page.

Diagram showing interaction between module-level and filter-level settings


Configuration

Module-Level Setting

Located in: Filter Posts Module > Content Tab > Main Settings

Update filter count and empty options for clicked item: Control first-filter behavior

This setting determines whether the FIRST filter item clicked remains unchanged while other filters update based on it.

Options:

  • NO (Default) - All filters hide empty options independently

    • The first clicked filter does NOT stay intact

    • Empty options in ALL fields are removed based on active filters

    • Creates balanced filtering where no single filter dominates

  • YES - First clicked filter stays intact, others update

    • Tracks the first filter item clicked as the "primary" filter

    • That first filter's options remain visible even if they become empty

    • Other filters dynamically hide empty options based on the first filter

    • Creates a "primary + refinement" filtering pattern

Example with YES:

If user clicks "Red" color first, ALL colors stay visible (Red, Blue, Green, etc.), but the Size filter automatically hides sizes that don't exist in red products.

Example with NO:

If user clicks "Red" color, then "Large" size, both the Color AND Size filters will update to hide options with zero results.


Filter Item Settings

Located in: Filter Posts Module > Content Tab > Filter Item Settings > [Individual Filter]

These settings control each filter's individual behavior regarding empty options.

Display Empty Filter Option: Show or hide options with zero count

Controls whether options with zero results are displayed at all.

Options:

  • YES - Show all options regardless of count (may display "Category (0)")

  • NO - Hide options that would return zero results

When to use YES:

  • You want users to see the complete taxonomy structure

  • Showing empty options provides context about what exists

  • Users need to understand all available categories/terms

When to use NO:

  • Keep the interface clean and focused

  • Only show what's actually available

  • Prevent user confusion from empty options

Hide empty options on page load: Initial state control

Hide empty options ONLY on initial page load, but show them once filtering begins.

Requirements:

  • "Display Empty Filter Option" must be set to YES

Behavior:

  • Initial page load: Only options with existing content are shown

  • After first filter interaction: All options appear (even empty ones)

Use case:

Present a clean initial view with only populated options, but provide comprehensive filtering once the user engages with filters.

Hide filter when it has no options: Conditional filter visibility

Hide the ENTIRE filter field (not just individual options) if it has zero applicable options.

Use case:

Product attributes or categories that don't apply to certain contexts.

Example:

On a "Shoes" category page, a "Screen Size" attribute filter (relevant for electronics) would be completely hidden since no shoes have screen sizes.

Entire filter vs individual options

This setting hides the whole filter field, while "Display Empty Filter Option" hides individual options within a visible filter.

Display Terms only Available to the Current Category or Archive Page: Context-aware filtering

Show only terms relevant to the current archive or category being viewed.

Availability:

  • Only works on archive pages and category/term pages

  • Does not apply on standard pages

Behavior:

Filters automatically adapt to show only options that apply to the current page context.

Example:

On a "Clothing > Accessories" category page, only show sizes and colors that exist for accessories within that specific category, hiding options from other clothing categories.

Only Show Available Options: Dynamic smart filtering (Checkbox/Radio only)

For checkbox and radio button filters, automatically hide options that would return zero results based on OTHER active filters.

Availability:

  • Checkbox filter type

  • Radio button filter type

Behavior:

Options dynamically update based on what's actually available given the current filter selections.

Example:

  1. User selects "Color: Red" from a checkbox filter

  2. The "Size" checkbox filter automatically hides all sizes that don't exist in red products

  3. Only sizes available in red are shown

This creates an intelligent, guided filtering experience.


Common Scenarios

Choose the configuration that matches your needs:

Scenario 1: Remove Other Empty Options (Default Behavior)

Best for: Preventing users from narrow dead-ends while keeping initial filter visible

Settings:

  • Module: "Update filter count..." = NO

  • Filter Items: "Display Empty Filter Option" = NO

Behavior:

  • First clicked filter stays mostly intact

  • Other filters hide empty options

  • Balanced approach between visibility and usability

Use case: Homepage or main shop page where you want to show main categories always, but refine sub-options.

View live demo →

Default behavior showing first filter intact, others refined


Scenario 2: Filter Out ALL Empty Options

Best for: Maximum refinement, only show what's currently available

Settings:

  • Module: "Update filter count..." = YES

  • Filter Items: "Display Empty Filter Option" = NO

Behavior:

  • After first filter click, ALL filters hide empty options (including the first one)

  • Most aggressive hiding of unavailable options

  • Users see only combinations that return results

Use case: Complex product catalogs where users need to see exactly what's available based on all active filters.

View live demo →

Aggressive filtering hiding all empty options across all filters


Scenario 3: Display All Options Always (No Dynamic Updates)

Best for: Showing complete taxonomy structure regardless of availability

Settings:

  • Module: "Update filter count..." = NO

  • Filter Items: "Display Empty Filter Option" = YES

Behavior:

  • All options always visible, even with (0) counts

  • No dynamic hiding based on filter interactions

  • Counts update but options never disappear

Use case: Educational sites, directories, or catalogs where seeing the full structure is important.

View live demo →

All filter options visible with counts showing availability


Scenario 4: Display All Options (With Dynamic Count Updates)

Best for: Always showing complete option list with live counts

Settings:

  • Module: "Update filter count..." = YES

  • Filter Items: "Display Empty Filter Option" = YES

Behavior:

  • All categories/tags stay visible after filtering

  • Counts dynamically update to show current availability

  • Users see what becomes available/unavailable without options disappearing

Use case: When users need to see all possible options but with updated counts showing what's available.

View live demo →

All options visible with dynamically updating counts


Scenario 5: Hide Empty on Page Load Only

Best for: Clean initial view, comprehensive filtering after engagement

Settings:

  • Module: Either setting works

  • Filter Items: "Display Empty Filter Option" = YES

  • Filter Items: "Hide empty options on page load" = YES

Behavior:

  • Initial page load shows only options with content

  • Once user interacts with any filter, all options appear (including empty ones)

  • Provides clean first impression with full filtering power after engagement

Use case: Product pages where you want a streamlined initial view but don't want to limit user exploration.

View live demo →

Clean initial view transforming to full options after first interaction


Scenario 6: Context-Aware Archive Filtering

Best for: Category/archive pages needing automatic adaptation

Settings:

  • Module: Either setting works

  • Filter Items: "Display Terms only Available to Current Category or Archive Page" = YES

Behavior:

  • Filters automatically show only options relevant to the current archive/category

  • Options change as user navigates between different category pages

  • No manual configuration needed per page

Use case: Multi-category WooCommerce shop or blog where filters should adapt to the current category context.

Example:

  • On "Clothing > Shirts" page: Shows only sizes/colors for shirts

  • On "Clothing > Pants" page: Shows only sizes/colors for pants

  • Each category gets contextually relevant filters automatically

View live demo →

Filters adapting to show only relevant options for current category

Archive pages only

This option only works on WordPress archive pages (category, tag, taxonomy archives). It will not function on standard pages.


Scenario 7: Hide Entire Filters When Not Applicable

Best for: Product attributes that don't apply everywhere

Settings:

  • Filter Items: "Hide filter when it has no options" = YES

Behavior:

  • If a filter has ZERO applicable options, the entire filter field disappears

  • Only filters with at least one option are shown

  • Different pages may show different sets of filters

Use case: Cross-category product catalogs where attributes vary greatly between categories.

Example:

  • Electronics category: Shows "Screen Size", "RAM", "Storage" filters

  • Clothing category: Shows "Size", "Color", "Material" filters

  • Electronics-specific filters disappear entirely on clothing pages

View live demo →

Different filter sets appearing based on category


Best Practices

Display Filter Count Requirement

The empty filter options feature requires "Display Filter Count" to be enabled because the plugin needs to calculate result counts to determine which options are empty.

If you don't want counts visible to users:

You can hide them with CSS while maintaining functionality:


.et_pb_module .radio-count {

display: none !important;

}

This keeps the count calculation active (required for empty options logic) but hides the numbers from user view.

Combining Settings

Be thoughtful about setting combinations:

 Good combinations:

  • Show all + Dynamic counts = Informative filtering

  • Hide empty + Context-aware = Smart, clean filtering

  • Hide on load + Show all = Progressive disclosure

L Avoid:

  • "Display Empty" = NO + "Hide on load" = YES (contradictory)

  • "Hide filter when no options" without testing across all category types

Testing

Always test empty filter behavior:

  1. On different archive pages - Category, tag, custom taxonomy archives

  2. With various filter combinations - See how options appear/disappear

  3. On initial page load vs after filtering - Verify hide-on-load behavior

  4. Across different categories - Ensure context-aware settings work correctly


Troubleshooting

Filters not hiding as expected

Check:

  • Filter Update Type is set to "On Change" (not "On Button Click")

  • "Display Filter Count" is enabled

  • Module-level and filter-level settings align with your intended scenario

Counts not updating

Possible causes:

  • Caching plugin interfering with AJAX

  • Filter Update Type set incorrectly

  • JavaScript errors in browser console

Solutions:

  • Clear all caches (site cache, browser cache, CDN)

  • Disable caching temporarily to test

  • Check browser console for JavaScript errors

Entire filter disappearing

If unexpected:

  • Check "Hide filter when it has no options" setting

  • Verify the filter has at least one option with posts

  • Ensure you're testing on appropriate archive/category pages

If desired:

  • This is working as intended when filters don't apply to certain contexts

Context-aware not working

Verify:

  • You're testing on an actual archive/category/tag page (not a standard page)

  • "Display Terms only Available to Current Category or Archive Page" is enabled

  • The taxonomy actually has terms associated with posts in that category


What's next?

Related Features:

Module Documentation: