Main

Taxonomy Term Meta Exclusions

Published

When Super Speedy Search searches your categories, brands and other taxonomy terms, it searches each term’s name, its description and the values in its term meta. Term meta is where plugins store extra data against a term, and most of it is not text a shopper would search for: image IDs, social image web addresses, sort orders, product counts, colour codes and SEO plugin settings. Left in, it causes odd matches. A category whose social image is https://example.com/wp-content/uploads/convex-social.jpg turns up for a search for “convex”, and a search for “10” lists every category whose sort order is 10.

Taxonomy Term Meta Exclusions tells the taxonomy search which term meta to ignore.

Available since 5.95.0.

Where to find it

Go to Super Speedy Search > Main. Taxonomy Term Meta Exclusions sits under Search Taxonomy Descriptions. It has three parts:

  • A box of term meta keys to ignore, one per line.
  • A Use the recommended list button that fills the box with the recommended keys.
  • A checkbox: Also skip values that are only a number, a web address, a colour code, serialized data or an ACF field reference.

Which searches it affects

It applies to the taxonomy search: the category, brand and attribute results Super Speedy Search finds from its terms index, such as the Suggest Taxonomies (legacy) list in the dropdown described in Taxonomy Search. Product and post searches are not affected, and neither are taxonomy combination suggestions, which match term names only.

The key list

Enter one meta key per line. Use * as a wildcard, so rank_math_schema_* covers every key starting rank_math_schema_. A line holding only * ignores all term meta.

Use the recommended list fills the box with keys that hold IDs, web addresses, flags, colour codes and settings, written by:

  • WooCommerce (thumbnail_id, display_type, order, product_count_* and others)
  • Super Speedy Filters (ssf_color_hex)
  • Rank Math and SEOPress (image, robots, canonical, schema and redirect settings)
  • The SEO Framework
  • Perfect Brands
  • Variation Swatches
  • Polylang

Pressing the button only fills the box. Save the settings to apply it.

SEO titles and descriptions stay searchable

The recommended list leaves out the Rank Math and SEOPress SEO titles and descriptions, so a category is still found by the words in its SEO title or description. While exclusions are in use, template variables in those fields, such as %term%, %sep% or %%sitetitle%%, are stripped before indexing, so the words “term” and “sep” do not become search matches.

Brand descriptions from Perfect Brands, Variation Swatches tooltip text and ACF text fields also stay searchable unless you add their keys.

Skipping values by shape

A key list cannot cover everything. ACF lets each site choose its own field names, so an image field on one store is called brand_logo and on another category_banner. With the checkbox ticked, any term meta value that is only one of these is skipped, whatever its key:

ShapeExample
A number40021, 12.5
A web addresshttps://example.com/image.jpg
A hex colour code#ff0000
PHP serialized dataa:2:{...}
An ACF field referencefield_5f1a2b3c

Each test is on the whole value. A sentence that contains a web address is still searched.

Common mistake

If you keep a supplier or reference code as a number in term meta and shoppers search for it, the value-shape checkbox skips it. Leave the checkbox off on that site, or store the code with a letter in it.

Applying a change: rebuild the index

Terms you save after changing the list are indexed with the new rules straight away. Every other term keeps its old indexed meta until the next rebuild. Until then, wp-admin shows this notice:

The taxonomy term meta exclusions changed since the last rebuild. Terms saved since then already follow them; rebuild to apply them to every term.

Search keeps working in the meantime. Rebuild from the settings page or with wp sss rebuild.

New installs and updated sites

A new install starts with the recommended list and the value-shape checkbox ticked.

A site that updates from an earlier version starts with an empty list and the checkbox unticked, so its taxonomy search matches exactly the same terms after the update. Nothing changes until you opt in: press Use the recommended list, save and rebuild.

For developers: the sspsss_term_meta_excluded_keys filter

The sspsss_term_meta_excluded_keys filter runs after the setting is read, and every build and search path uses its result, so you can add or remove keys in code:

add_filter( 'sspsss_term_meta_excluded_keys', function ( $keys, $settings ) {
    $keys[] = 'brand_story_image';
    $keys[] = 'my_plugin_*';
    return $keys;
}, 10, 2 );

The patterns follow the same rules as the box: exact keys, with * as a wildcard. A change to the filter’s output also raises the rebuild notice, so rebuild after deploying it.

Further reading

the rest of the Main tab
the suggestions built from term names
every hook and filter

Written for Super Speedy Search 5.95.0.

Comments

▲
▼
1/1