Filter Product by Custom Fields in WooCommerce

Filters By
Updated Nov 8, 20263 min read

PRO A custom field is extra information saved on a product, such as “Made In” or “Warranty”. This filter turns those values into choices for shoppers, so they can pick “Made In: Italy”. It needs the Pro version.

You can try custom field filters on the live demo.

WooCommerce custom field filter for Made In with country values

Is a custom field the right choice?

If you are starting fresh, a WooCommerce attribute is usually simpler, and our attribute filter guide shows how. Use custom fields when your data is already saved that way, for example by another plugin or a product import.

Step 1: Add the field to your products

  1. Open a product and find the Custom fields box. If you do not see it, you can turn it on in the block or screen options of the product editor.
  2. Add a name, such as made_in, and a value, such as Italy.
  3. Click Update.

For example, one product could have the name material and the value Cotton, and another material and Wool. Using one name on every product puts those values together in one filter. Avoid mixing material, Material and product_material for the same thing, because each becomes its own field.

Keep names and values spelled the same on every product. “Italy” and “Italia” become two separate choices. Plugins such as ACF can add the fields for you, which helps prevent typing mistakes.

Step 2: Turn on the filter

In Product Filters > Form Manage, set Show Custom Fields Filter to On.

Show Custom Fields Filter switch on the Form Manage tab

The gear button beside it opens Exclude Custom Fields, where you can hide any field shoppers should not see. Fields whose names start with an underscore are private, so the plugin skips them for you.

Step 3: Style one field at a time

On Form Style, choose Custom Fields under Configure Style for, then pick a field in the second list.

Custom Fields selected with a second list for choosing one field

All the list styles are available. Checkbox suits a few values, and Select suits a long list such as countries.

Step 4: Settings that matter here

  • Operator: OR suits most fields, because a product usually has one value for each.
  • Include/Exclude Terms From Filters: leave out values you do not want listed.
  • Order Values/Terms By: Numeric keeps values like 1, 2 and 10 in the right order.

The category filter settings table explains the others. Click Save Changes, then repeat Step 3 for your next field.

Step 5: Show it on your store

Filters on your shop page update by themselves. For another page, paste the shortcode below or read our guide to adding filters to your store.

[plugincy_filters]

Examples of custom fields

Field nameExample valuesWho it helps
made_inItaly, Japan, USAShoppers who care where products come from
warranty1 Year, 2 YearsElectronics and appliance buyers
energy_ratingA, B, CHome appliance shoppers
supplierYour supplier namesTrade customers with a preferred supplier

Good habits

  • Agree on the values first, and write them down so everyone spells them the same way.
  • Give the field a clear Widget Title. Shoppers should see “Made In”, not made_in.
  • Keep each value short. Long sentences make poor filter choices.
  • If you use filter links in your SEO settings, our SEO setup guide covers the prefixes.

If something looks wrong

  • A field is not listed: check that a product uses it, that its name does not start with an underscore, and that it is not in Exclude Custom Fields.
  • The same value appears twice: spelling differs between products. Make them match.
  • A change does not show: click Clear Cache under Advance Settings.