Coupon meta keys and stored data
Updated September 15, 2026
This reference lists where Better Coupon Restrictions stores its data, for developers who import coupons, migrate stores or read restrictions in their own code.
Coupon meta
All restrictions are saved as post meta on the shop_coupon post. Blank fields are deleted rather than stored empty.
| Area | Meta keys |
|---|---|
| Products | bcrw_enable_product_restrictions (1/0), bcrw_product_conditions (any/all), bcrw_products |
| Categories | bcrw_enable_category_restrictions, bcrw_category_conditions, bcrw_category_sum_quantities, bcrw_categories |
| Attributes | bcrw_enable_attribute_restrictions, bcrw_allowed_attributes, bcrw_exclude_attributes |
| Cart | bcrw_required_cart_quantity, bcrw_required_cart_subtotal, bcrw_required_cart_weight |
| Date | bcrw_start_date, bcrw_end_date (Y-m-d), bcrw_start_time, bcrw_end_time (H:i), bcrw_months_available (1–12), bcrw_weekdays_available (1 = Monday to 7 = Sunday) |
| Customer | bcrw_new_customer (yes), bcrw_customer_logged_in_status (yes/no), bcrw_allowed_customer_user_roles, bcrw_disallowed_customer_user_roles |
| Checkout | bcrw_allowed_payment_methods, bcrw_disallowed_payment_methods, bcrw_allowed_shipping_methods, bcrw_disallowed_shipping_methods |
| Address (PRO) | bcrw_address_type, bcrw_address_countries, bcrw_address_zone_region, bcrw_address_zip, bcrw_coupon_per_address |
| History (PRO) | bcrw_total_customer_spend, bcrw_total_customer_orders, bcrw_purchased_products, bcrw_not_purchased_products |
| Time (PRO) | bcrw_maximum_hours_since_last_order, bcrw_minimum_hours_since_last_order, bcrw_maximum_hours_since_registered, bcrw_minimum_hours_since_registered |
| Usage (PRO) | bcrw_usage_window_limit, bcrw_usage_window_value, bcrw_usage_window_unit (hours/days/month), bcrw_coupon_per_ip |
| Lists (PRO) | bcrw_allow_domain, bcrw_disallow_domain, bcrw_allow_ip, bcrw_disallow_ip, bcrw_allow_email_domain, bcrw_disallow_email_domain (newline separated) |
| Other (PRO) | bcrw_custom_user_meta, bcrw_custom_cart_item_meta, bcrw_cookie_name, bcrw_cookie_value, bcrw_url_only, bcrw_ignore_global |
| Messages | bcrw_message_{section}, for example bcrw_message_cart |
Product rows in bcrw_products are arrays with product_id, variation_id, min_quantity and max_quantity. Category rows in bcrw_categories have category_id, min_quantity and max_quantity. A blank quantity means no limit. Attributes are stored as slugs without the pa_ prefix.
Excluded products and categories are stored in WooCommerce’s own exclude_product_ids and exclude_product_categories meta.
Options
bcrw_settings: array of PRO global settings, with keys such asbcrw_global_new_customers_only,bcrw_global_customer_logged_in_status,bcrw_global_individual_use,bcrw_global_exclude_sale_items,bcrw_global_allow_domain,bcrw_global_disallow_domain,bcrw_global_allow_ip,bcrw_global_disallow_ipandbcrw_global_enable_rejection_analytics.bcrw_rejections_db_version: set once the rejection log table exists.- Transient
bcrw_domain_restrictions_in_use: cached for a day and cleared when a coupon or the settings are saved.
Rejection log table
{prefix}bcrw_rejections, created when analytics is first enabled, with the columns id, coupon_id, coupon_code, check_name, message, customer and created_at (GMT).
Cookie and session
- Cookie
bcrw_referrer(PRO): referring domain, 30 days, HTTP only. - WooCommerce session keys
bcrw_link_couponsandbcrw_pending_link_coupons(PRO): codes from coupon links.


