Skip to content

Creating Custom Filters with Metafields

What Are Custom Filters?

In addition to the built-in filters (colour, size, price, tags), you can create filters for any product attribute — Brand, Material, Width, Fit, or anything your catalogue needs. Custom filters use the Metafields system and appear in the storefront sidebar automatically once products have values.

Step 1 — Create a Metafield Definition

  1. Go to Admin → Settings → Custom Data (or Settings → Metafields).
  2. Under Product Metafields, click + Add Definition.
  3. Fill in:
    • Name — the human-readable label (e.g. "Brand").
    • Namespace — a grouping prefix (e.g. "custom").
    • Key — the identifier (e.g. "brand").
    • Field type — choose from: Single line text, Number (integer), Number (decimal), True/False, Color, or List of text values.
  4. Check "Available as filter on collection pages".
  5. Optionally set a filter label and display type (chips, swatches, etc.).
  6. Click Create.

Cartly automatically updates the search index schema. This takes a few seconds.

Step 2 — Assign Values to Products

  1. Open a product at Admin → Products → [product name].
  2. Scroll to the Metafields section at the bottom of the page.
  3. Find your new definition (e.g. "Brand") and enter a value (e.g. "Nike").
  4. Click Save.

Cartly reindexes the product automatically. Repeat for all products you want included in this filter. Once at least one product has a value, the filter bucket appears in the collection sidebar.

Step 3 — Customise the Filter (Optional)

The new filter appears automatically with default settings. To customise it:

  1. Go to Admin → Settings → Storefront Filters.
  2. Click + Add filter.
  3. In the modal, scroll to the Product Metafields section and select your new filter.
  4. Set the label, display type, position, and scope (Global or a specific collection).
  5. Click Save.

Frequently Asked Questions

How long does it take for the filter to appear?

Usually a few seconds after you save a product with a metafield value. The product is reindexed automatically on save. If the filter does not appear after a minute, use Reindex products in Settings → Storefront Filters.

What field types support filtering?

Single line text, Number (integer), Number (decimal), True/False, Color, and List of text values. Date and Rich text fields are not supported as filter types.

Can I filter by variant metafields?

Yes — create a Variant Metafield Definition and check the filterable toggle. The URL scheme uses a filter.v.v.metafields. prefix for variant metafields.

Was this helpful?