Taxonomy combination suggestions
Taxonomy combination suggestions let your search dropdown surface filtered-archive landing pages as users type — e.g. typing “dog” surfaces “Dog Grooming ▸ Cool Dogs Co ▸ Red” with an accurate post count, and clicking it lands the user on the filtered product archive. Unlike single-term taxonomy hints, combinations join 1, 2, or 3 taxonomy terms into a single suggestion, ranked by how completely the user’s typed words actually claimed the row’s terms.
Table of Contents
How it works
A nightly (or on-demand) precompute step scans your published posts and builds a table of every (post type, taxonomy A, taxonomy B, taxonomy C) combination that actually exists, along with the post count for each row. When a user types into the search box, SSS runs a fast FULLTEXT lookup against the precomputed table and returns the rows whose terms best match the typed tokens.
Because the rows are precomputed, suggestions are instant — the cost is the rebuild, not the query.
The table only contains combinations that exist on real published posts, so users never see suggestions that would lead to an empty archive. Combinations below the configured minimum post count are also omitted.
Enabling the feature
Two switches are needed:
- Settings → Super Speedy Search → Ajax Search tab, in the Enable Suggestions block — tick Enable Taxonomy Suggestions. The same block has Enable Post Title Suggestions (the existing token-based suggestions); these two can be toggled independently.
- Settings → Super Speedy Search → Suggestions tab, Taxonomy Suggestions section — configure at least one combination row, then trigger a rebuild.
Configuring combinations
The Combinations table is where you decide which (post type, taxonomies) shapes get indexed. Each row produces one set of suggestions.
| Column | What it means |
|---|---|
| Post Type | The post type the combination applies to. Required. Only public, non-exclude_from_search post types appear in the dropdown. |
| Show Post Type Name | Whether to include the post type label in the suggestion. Don’t Show (default), Show at Start (e.g. “Product ▸ Excavators ▸ Caterpillar”), Show at End (“Excavators ▸ Caterpillar ▸ Product”). Takes effect immediately — no rebuild needed. |
| Taxonomy A | First taxonomy slot. Required. |
| Taxonomy B | Optional. If filled, suggestions become two-term (“Excavators ▸ Caterpillar”). |
| Taxonomy C | Optional. If filled, suggestions become three-term (“Excavators ▸ Caterpillar ▸ Yellow”). |
The depth of the combination is inferred from how many taxonomy slots you fill — leave B and C empty for single-term suggestions; fill A and B for pairs; fill all three for triples.
The Taxonomy A/B/C dropdowns are scoped to the taxonomies registered for the selected post type, so you can’t accidentally pick a taxonomy that doesn’t apply to that CPT.
You can have multiple rows targeting the same post type. Each row produces its own set of suggestions. The same (make, category) pair that exists in multiple post types produces one suggestion row per post type, each with its own post count and post-type label — useful when several CPTs share taxonomies.
Behaviour
Minimum post count per combination
Combinations with fewer matching posts than this threshold are omitted from the precomputed table. Default: 1. Raise this if you find rare combinations are cluttering the suggestion list.
Maximum suggestions returned per search
Caps the total list size. Default: 8. Ignored when the Segmented result layout is active (see below).
Match algorithm
Each typed word can claim at most one term in a row. Suggestions are ranked first by how completely the row was claimed (perfect-fit on top — every term claimed by some typed word), then by how many terms were claimed (a 3-term match beats a 2-term beats a 1-term).
Two algorithms are available:
- Optimal (default, recommended) — greedy left-to-right: each typed word claims the first term it matches, then is done. Order-insensitive across terms. Typing
dogs groomingmatches a row of (Dog Grooming, Cool Dogs Co) just as well as typinggrooming dogs. - Strict order — tokens claim terms left to right in admin order (Taxonomy A → B → C). Out-of-order typing scores lower. Use this when you’ve set Taxonomy A/B/C in the order you expect users to type — e.g. brand-first stores might set A = brand, B = category, and want “Caterpillar excavators” to rank higher than “Excavators Caterpillar”.
Rows where the search only matched the post-type label (no term was claimed by any typed word) are not returned.
Result layout
How the suggestion list is filled:
- Mixed (default) — rank all matching combinations together by best-fit; the top entries fill the list up to the Maximum suggestions returned per search cap.
- Segmented by depth — reserve a configurable slot count for each depth. Default: 4 singles + 3 pairs + 3 triples = 10 total. If a depth has fewer matches than its slot count, unused slots are given to depths that have more matches. The Maximum suggestions returned cap is ignored — total list size = singles + pairs + triples.
Use Segmented when your shop has deep taxonomies and you want users to always see a mix of broad categories, two-term refinements and three-term filters. Use Mixed when raw best-fit ranking is what you want.
Click destinations
Clicking a suggestion lands the user on a filtered archive page. The URL is built at read time so the click destination always reflects the current taxonomy state:
- With Super Speedy Filters active — URLs route through SSF’s pretty permalink builder. A click on “Dogs ▸ Dog Grooming ▸ Cool Dogs Co ▸ Red” lands on e.g.
/product-category/dogs/dog-grooming/brands/cool-dogs-co/color/red/. Requires the SSF Pretty URLs add-on. - Without Super Speedy Filters — URLs use the WooCommerce/taxonomy archive form with the other terms applied as query args. The destination still works, just with a less pretty URL.
No dependency on SSF is required for the feature to work — the pretty URL is an enhancement when SSF is present.
Rebuilding
Combinations need a rebuild whenever you change the Combinations rows (add/remove a row, change taxonomies) or when the underlying posts change in a way that adds new combinations or moves rows above/below the minimum post count threshold.
Three rebuild paths:
| Command | What it does |
|---|---|
wp sss rebuild taxonomy_suggestions | Only the taxonomy-combinations table. Useful as a nightly cron because triples can be expensive on large catalogues. |
wp sss rebuild all | Full rebuild — search index, post-title suggestions, then taxonomy combinations as the final step. |
wp sss rebuild (no scope) | Same as wp sss rebuild all. |
Notes:
wp sss rebuild searchandwp sss rebuild suggestionsintentionally skip taxonomy combinations. Usetaxonomy_suggestionsorallto include them.- If the admin Rebuild button times out (typically because triples take longer than the 30-second PHP request timeout), switch to the CLI. The CLI sidesteps the PHP timeout entirely.
- A reasonable cron entry for nightly refreshes:
0 3 * * * cd /path/to/wp && wp sss rebuild taxonomy_suggestions >> /var/log/sss-taxonomy.log 2>&1.
Changing Show Post Type Name is the one combination-related setting that does not need a rebuild — it’s applied at render time.
REST endpoint
GET /wp-json/sss/v1/combinations/<term> returns matching combinations as JSON. Useful for custom integrations that want to query the precomputed table without going through the SSS search box (e.g. a separate “browse by category” widget).
Dropdown rendering
- Matching prefix tokens are bolded in the suggestion text — typing “dog to” bolds “Dog” and “To” in “Dog Toys”, matching the existing post-title suggestions.
- Padding, hover and link colour match the post-title and taxonomy lists for visual consistency in the dropdown.
- When Enable our ultra-fast ajax is on (Advanced tab), combinations now go through the same fast-ajax mu-plugin path that post-title and taxonomy suggestions already use — previously combinations fell through to the standard WP REST API path and were noticeably slower than the other suggestion types.
Where the data lives
- Precomputed combinations:
wp_sss_taxonomy_combinations(FULLTEXT index on the combined-token column) - The combinations rebuild reads from
wp_postsand the taxonomy tables, writes to this single table.
The table is rebuilt from scratch each time — there’s no incremental refresh in 5.52.
Tips
- Start with one combination row. It’s easier to tune the result layout and minimum count against a single combination’s output than several at once.
- Set the minimum post count to something meaningful. If you have a long tail of rare combinations, raising the minimum to 3 or 5 keeps the suggestion list focused on combinations users will actually click.
- Triples are expensive. If your rebuild times out, drop a triple row to two slots, raise the minimum post count, or move the rebuild to CLI/cron.
- Use Segmented layout when your suggestions list feels too narrow. Mixed layout naturally biases toward the deepest matching rows when typed-word coverage is high; Segmented forces a mix of breadth and depth.