Restrict a coupon by user meta, cart item meta or cookie (PRO)
Updated September 15, 2026
The Meta Data and Cookie sections (PRO) let you build custom rules using data stored by your own code or another plugin. Find them near the end of the Better Coupon Restrictions tab.
Custom User Meta
Enter a user meta key, optionally followed by a colon and a value:
membership_level:goldrequires the logged in user’smembership_levelmeta to equalgoldexactly.vip_customerrequires the meta key to be set to any non-empty value.
Guests have no user meta, so they cannot use the coupon. Message: “This coupon is not valid for your account.”
For security, private keys cannot be used. Keys WordPress treats as protected (starting with an underscore), the capabilities and user level keys, and session tokens are ignored, and the rule is skipped. This stops the coupon being used to probe private account data.
Custom Cart Item Meta
Uses the same key:value or key format, checked against the data stored on each cart item. The coupon is valid when at least one item in the cart matches. This suits data added by product add-on or personalisation plugins that store a simple text value on the cart item.
Values that are lists or arrays never match a typed value. Message: “This coupon is not valid for the items in your cart.”
Cookie
- Cookie Name: the cookie that must be present.
- Cookie Value: the exact value required. Leave blank to only require that the cookie exists.
Message: “This coupon is not valid for your account.”
Matching rules
Values are compared as exact text and are case sensitive. Leave a field blank to switch the rule off. The Meta Data section shares one Custom Error Message; the Cookie section has its own.


