DocsDynamic data & loops
Filters (facets)
Let visitors narrow a Query Loop with checkboxes, dropdowns, buttons, search, price and number ranges, dates, ratings and a sort menu — with live counts, shareable URLs and no page reloads.
A Filter is an element you place near a Query Loop. Visitors pick choices and the loop shows only what matches, right away, without the page reloading. Each choice shows how many results it would give.
The quickest start: Add → Loops → Filterable Blog or Shop with Filters — a section with a sidebar of filters, a result count and sort menu above the results, active filters as removable chips, and the loop. On tablets and phones the sidebar becomes a Filters button that slides the filters in. Or add single filters from Elements → Dynamic data (Checkbox Filter, Dropdown Filter, Price Slider, Sort Menu…).
Kinds of filter#
| Kind | What visitors do |
|---|---|
| Checkboxes, Buttons | Pick several choices (or one, for buttons set to one at a time). |
| Radio buttons, Dropdown | Pick one choice, or “All”. |
| Search box | Type keywords; results update as they type. |
| Range slider, Min and max | Choose a number range, like a price from $50 to $200. |
| Date range | Choose from and to dates. |
| Star rating | 4 stars & up, 3 stars & up… |
| Sort menu | Choose the order: newest, price low to high, best rated… |
| Active filters | See what they chose and remove any of it. |
| Reset button | Clear every filter of the loop. |
| Result count | “24 results”, updated as they filter. |
What a filter filters by#
- Taxonomies — categories, tags, any custom taxonomy, WooCommerce product categories and product attributes (Color, Size…).
- Custom fields — any custom field or ACF field, compared as text, numbers or dates. ACF choice labels are shown, and checkbox fields that store several values work.
- Post data — author, post type, publish date and keyword search.
- WooCommerce — price, average rating, stock status and on sale.
Select a filter and open its Content tab: pick its kind, what it filters by (a searchable list of this site’s taxonomies and fields) and its options — whether several choices match any or all of them, counts, hiding empty choices, their order, child terms under their parents, “Show more” after a number of choices, a range’s unit (like $) and bounds, and the orders a sort menu offers.
Filters on phones#
Put the filters in a Filters Drawer (the ready-made layouts already do). On wide screens its contents show as they are, as a sidebar. From the breakpoint you choose — tablets and phones, phones only, every screen, or never — it becomes a Filters button showing how many filters are active; tapping it slides the filters in from the left or right, with a close button and a Show 12 results button that closes the drawer and returns to the results. Escape, the close button and tapping outside close it too, and the page doesn’t scroll behind it.
On the canvas, the drawer’s contents stay visible under its button at every breakpoint, so the filters in it can be edited and styled.
Which loop a filter narrows#
A filter narrows the nearest Query Loop: the one in the same section or column group, so a sidebar of filters finds the grid beside it. To be explicit, choose the loop under Narrows in the filter’s Content tab. Several filtered loops can share a page; each keeps its own filters.
Shareable addresses#
Choices are kept in the page’s address — /shop/?_category=faucets&_price=50,200&_sort=price-asc — so a filtered page can be bookmarked, shared and reloaded, and the Back button works. Each filter’s name in the address comes from what it filters (_color, _price); change it under Name in the address.
On the canvas#
Filters show the loop’s real choices and counts while you design; active filters show sample chips so they can be styled. Style every part in the Design tab — the label, choices, count badges, buttons, the slider, the chips. Filtering itself happens on the published page: preview it to try.
Good to know#
- Filters narrow loops over WordPress posts, pages, products and custom post types — not loops over external data.
- Counts are worked out for the current choices over the loop’s own query, so they always match what the loop would show.
- Private custom fields (names starting with
_) and fields that look like credentials can’t be used, as with dynamic data. - Pagination and Load more keep the choices.
Related articles
Still have a question? Email us at support.