Conditions
Conditions define when a rule should apply. You can set rules based on specific criteria and control how they are evaluated.
You can configure rules to apply:
- If All of the selected conditions are met (AND logic).
- If Any of the selected conditions are met (OR logic).
Conditions define when a rule should apply. You can set rules based on:
| Condition Type | Description | Comparison Method | Version |
|---|---|---|---|
| Product Title | Matches a keyword in the product title | Text-Based | Free |
| Product Description | Matches a keyword in the product description | Text-Based | Free |
| Price | Checks if the product price is greater/less than a value | Number-Based | Free |
| Type | Applies to "Simple", "Grouped", "External", "Variable" products | Specific Value (Simple, Variable, Grouped, External) | Free |
| Days Since Created | Compares the UTC timestamp of the creation date with the current time | Number-Based | Free |
| Days Since Modified | Compares the UTC timestamp of the modified date with the current time | Number-Based | Free |
| Total Sales | Applies based on total product sales | Number-Based | Free |
| Average Rating | The product's average customer review rating, from 0 to 5 (0 if the product has no reviews). Available from version 1.2.11. | Number-Based | Free |
| Review Count | The number of approved customer reviews. Available from version 1.2.11. | Number-Based | Free |
| Stock Status | Applies when stock is "In Stock", "Out of Stock", or "On Backorder". Works for all products regardless of whether stock management is enabled. | Specific Value (In Stock, Out of Stock, On Backorder) | Free |
| Manage Stock Enabled | Checks whether WooCommerce stock management (quantity tracking) is enabled for the product (Yes/No) | Specific Value (Yes, No) | Free |
| Stock Quantity | Compares stock levels with a number. Only applies to products with stock management enabled. | Number-Based | Free |
| On Sale | Checks if the product is currently on sale (Yes/No) | Specific Value (Yes, No) | Free |
| Attribute Value | Matches the selected terms of a WooCommerce attribute | List-Based | Free |
| Attribute Term Name | Matches the names of the product's attribute terms, across all attributes | Category-Based | Free |
| Meta Field | Uses custom WooCommerce meta fields | Text-Based, Number-Based | Free |
| Category Value | Matches the categories you select from a list | List-Based | Free |
| Category Names | Matches based on product categories | Category-Based | Free |
| Tag Names | Matches based on product tags | Category-Based | Free |
| Brand Name | Matches a specific brand | Category-Based | Pro |
| Brand Value | Matches the brands you select from a list (needs the product_brand taxonomy) | List-Based | Pro |
| Custom Taxonomy Name | Applies based on a custom taxonomy | Category-Based | Pro |
| Index | The product's position in the run (1, 2, 3, ...) | Number-Based, see Index and Probability | Pro |
| Probability (%) | Each product matches with the chance you enter, from 0 to 100 | A number, see Index and Probability | Pro |
| Probability (count) | About the number of products you enter match, chosen at random | A number, see Index and Probability | Pro |
Comparison Methods
Text-Based Comparisons
Applies to: Product Title, Product Description, Meta Fields
Is exactlyIs exactly (case-insensitive)Is not exactlyIs not exactly (case-insensitive)ContainsContains (case-insensitive)Does not containDoes not contain (case-insensitive)
Category & Taxonomy-Based Comparisons
Applies to: Category Names, Tag Names, Attribute Term Name, Brand Name (Pro), Custom Taxonomy Name (Pro)
Include- Matches only if the product has a category exactly matching the provided string.Include (case-insensitive)Do not include- matches products that do not have any categories or tags fully matching the provided stringDo not include (case-insensitive)Include one or more containing- Matches if at least one of the product's categories contains the provided string (not necessarily an exact match).Include one or more containing (case-insensitive)Do not include any containing- matches products that have not category/s or tag/s containing the provided stringDo not include any containing (case-insensitive)
List-Based Comparisons
Applies to: Attribute Value, Category Value, Brand Value (Pro)
Pick one or more values from a list, then choose how to match them:
is- matches if the product has at least one of the selected values.is not- matches if the product has none of the selected values.is onlyPro - matches if the product has exactly the selected values: all of them, and no others.is setPro - matches if the product has any value for the attribute. Attribute Value only.is not setPro - matches if the product has no value for the attribute. Attribute Value only.
Numeric Comparisons
Applies to: Days Since Created, Days Since Modified, Stock Quantity, Price, Total Sales, Average Rating, Review Count, Index (Pro), Meta Fields
Is exactlyIs not exactlyGreater thanGreater than or equal toLess thanLess than or equal toBetweenNot Between
Date Comparisons
The "Days Since Created" and "Days Since Modified" conditions are based on the WooCommerce timestamp fields:
- Created Date:
post_date_gmt - Modified Date:
post_modified_gmt
These timestamps are stored in UTC time, and comparisons are done against the current UTC time. The system calculates the elapsed time by subtracting the UTC timestamp of the creation/modification date from the current UTC timestamp. Evaluation of this condition includes fractional days (at seconds resolution).
For example:
- If 3 days and 6 hours have elapsed since creation, this is evaluated as 3.25 days.
- A rule with
greater than 3would apply, while a rule withequal to 3would not.
This ensures precise comparisons but also means that manual edits to product timestamps may affect rule execution. Reference: WooCommerce WC_DateTime Class
Meta Fields with Number Operators
Available from version 1.2.11.
Text operators compare a meta field value as text. For example, is exactly 5 doesn't match a stored value of 5.00. To compare the value as a number, use a number operator. The operator list for a meta field has two groups: Text (the text operators) and Number:
EqualsDoes not equalGreater thanGreater than or equal toLess thanLess than or equal toBetweenNot between
With a number operator, the meta value is compared as a number, so 5, 5.0 and 5.00 are equal. A decimal comma (4,5) is also accepted.
A number operator only matches products where the meta field contains a number. If the field is missing, empty or contains text, the condition doesn't match, whichever operator you choose. This includes Does not equal and Not between.
Examples of Meta Fields
When using meta fields in conditions, you can select from a variety of WooCommerce product metadata options. Below is an example list of WooCommerce meta fields:
| Meta Field | Description |
|---|---|
_sku | Product SKU (Stock Keeping Unit) |
_price | Current product price |
_regular_price | Regular price (without discounts) |
_sale_price | Sale price (if applicable) |
_stock | Current stock quantity |
_stock_status | Stock availability (instock, outofstock, onbackorder) |
_manage_stock | Whether stock management is enabled (yes or no) |
_sold_individually | Whether the product is sold individually (yes or no) |
_downloadable | Whether the product is downloadable (yes or no) |
_download_limit | Number of times a file can be downloaded |
_download_expiry | Expiration date for downloads |
_downloadable_files | List of downloadable file links |
_virtual | Whether the product is virtual (yes or no) |
_wc_average_rating | The product's average customer rating (or use the Average Rating condition) |
_wc_review_count | The total number of reviews for the product (or use the Review Count condition) |
_tax_class | The tax class assigned to the product |
_tax_status | The tax status (taxable, shipping, none) |
_thumbnail_id | The ID of the product's main image |
_product_attributes | Serialized data for product attributes |
_product_image_gallery | Serialized list of additional product images |
_product_url | External product URL (for affiliate products) |
_product_version | The version of the product |
_button_text | Custom button text for external/affiliate products |
_children | Stores child product IDs (for grouped products) |
_edit_last | The last user who edited the product |
_edit_lock | Timestamp for post lock editing |
total_sales | Total sales count for the product |
_backorders | Whether backorders are allowed (yes, no, or notify) |
_wp_old_date | Stores the previous post date |
_wp_old_slug | Stores the previous product slug |
_wpcom_is_markdown | Determines if the product description is written in Markdown |
Additional Resources
For a full list of WooCommerce meta fields, visit the WooCommerce Developer Documentation or check the wp_postmeta table in your WordPress database.
Index and Probability Pro
These conditions pick products by their position in the run or at random, rather than by product data.
- Index: each product gets a number (1, 2, 3, ...) in the order the rule processes it. Compare it like any number; for example,
greater than 10skips the first 10 products. - Probability (%): enter a number from 0 to 100. Each product has that chance of matching;
25matches about 250 of 1,000 products,100matches all and0matches none. - Probability (count): enter roughly how many products should match. For example,
5matches about 5 products, chosen at random from your catalog.
The products picked by the probability conditions change on every run, and the exact count varies.
With All conditions, conditions are checked from top to bottom and checking stops at the first one that fails. Order matters here:
- Put Index first. Its counter only goes up when the condition is reached, so if it comes after other conditions, the numbering is off.
- Put conditions that filter products, such as Index, before Probability.