---
title: Can I discount products by a custom field?
description: "Yes. Pricepep's Product metadata condition reads a custom field on the product, such as a supplier or a clearance checkbox, and compares its value."
url: "https://pricepep.com/docs/can-i-discount-products-by-a-custom-field/"
updated: "2026-12-02"
category: FAQ
---

# Can I discount products by a custom field?

Yes. Under a rule's **Products**, add **Product metadata**, type the field's meta key, choose an operator and type the value. Example: products whose custom field `supplier` **equals** `Acme` get 10% off: an Acme kettle costs $54.00 instead of $60.00; products from other suppliers keep their price.

## How do I set it up?

1. Go to **WooCommerce > Pricepep > Product Pricing** and click **Add Rule**.
2. Set **Method** to **Simple adjustment**, and under **Adjustment** choose **Percentage discount** and type `10`.
3. Under **Products**, click **Add Product** and choose **Product metadata**.
4. Type the meta key in the first box ("data key"), here `supplier`, choose **equals**, and type `Acme` in the last box ("value").
5. Click **Save Changes**.

## Which operators can I use?

| Operator | Example |
| --- | --- |
| **equals**, **does not equal** | `supplier` equals `Acme` |
| **contains**, **does not contain**, **begins with**, **ends with** | `collection` contains `winter` |
| **is checked**, **is not checked** | `clearance` is checked: any value except empty or 0 counts as ticked, "no" too; for yes/no fields use **equals** `yes` |
| **is empty**, **is not empty** | `supplier` is empty |
| **less than**, **less or equal to**, **more than**, **more or equal to** | `_wc_average_rating` more or equal to 4 |

## What should I know?

- **Text comparisons are case-sensitive.**
- **Variable products:** the parent product's value is checked first; a variation's own value counts only when the parent has no value saved for that key (an empty saved value counts as a value). Set the field on the parent to cover every variation, or leave it off the parent and set it on single variations. WooCommerce's own fields always have a value on the parent, so variations are compared by the parent's, for example its SKU.
- **WooCommerce's own fields** work by their meta key and are read through WooCommerce, for example `_sku` (see [products by SKU](/docs/can-i-select-products-by-sku-in-a-pricing-rule/)), `_wc_average_rating` or `_wc_review_count`.
- **Weight and dimensions:** since 2.6.0 use the conditions **Product weight**, **Product length**, **Product width** and **Product height** instead, for example **Product weight (kg)** **at least** `2`; see [product conditions](/docs/product-conditions/#product-weight). They read each variation's own weight, or the parent product's when the variation has none. **Product metadata** with `_weight`, `_length`, `_width` or `_height` (in the units set in **WooCommerce > Settings > Products**) still works, but compares the value entered on the parent product (its **Shipping** tab), so weights entered only on variations aren't seen.
- **Where it works:** **Products**, **Products - Buy** and **Products - Get** in product pricing rules, and **Items** in cart discounts and checkout fees with a per cart item or per cart line method.

The condition's reference is in [product conditions](/docs/product-conditions/). For fields on customer accounts, see [discounts based on a custom user field](/docs/can-i-give-discounts-based-on-a-custom-user-field/).

## Frequently asked questions

### Where do I find the meta key?

It's the name the value is saved under on the product. Custom field plugins normally use the field's name; a developer can look it up in the post meta table.

### Can I use WooCommerce's own product data?

Yes, by its meta key. For example _wc_average_rating more or equal to 4 matches products rated 4 stars or more.

### Is the comparison case-sensitive?

Yes. Acme doesn't equal acme, so type the value exactly as it is saved.

### Can I discount products by weight or size?

Yes. Since 2.6.0 use the Product weight, Product length, Product width and Product height conditions, for example Product weight (kg) at least 2. They read a variation's own value. Product metadata with the key _weight compares the parent product's value for variations.

## Related articles

- [Product conditions: products, categories, tags, price](https://pricepep.com/docs/product-conditions/)
- [Can I select products by SKU in a pricing rule?](https://pricepep.com/docs/can-i-select-products-by-sku-in-a-pricing-rule/)
- [Can I give discounts based on a custom user field?](https://pricepep.com/docs/can-i-give-discounts-based-on-a-custom-user-field/)

All articles in [FAQ](https://pricepep.com/docs-category/faq/)
