Skip to main content

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 TypeDescriptionComparison Method
Product TitleMatches a keyword in the product titleText-Based
Product DescriptionMatches a keyword in the product descriptionText-Based
PriceChecks if the product price is greater/less than a valueNumber-Based
TypeApplies to "Simple", "Grouped", "External", "Variable" productsSpecific Value (Simple, Variable, Grouped, External)
Days Since CreatedCompares the UTC timestamp of the creation date with the current timeNumber-Based
Days Since ModifiedCompares the UTC timestamp of the modified date with the current timeNumber-Based
Total SalesApplies based on total product salesNumber-Based
Stock StatusApplies when stock is "In Stock", "Out of Stock", or "On Backorder"Specific Value (In Stock, Out of Stock, On Backorder)
Stock QuantityCompares stock levels with a numberNumber-Based
On SaleChecks if the product is currently on sale (Yes/No)Specific Value (Yes, No)
Attribute ValueApplies based on a specific attribute valueSpecific Value (Select from WooCommerce attributes)
Meta FieldUses custom WooCommerce meta fieldsNumber-Based or Text-Based
Category NamesMatches based on product categoriesCategory-Based
Tag NamesMatches based on product tagsCategory-Based
Brand Name (Pro)Matches a specific brand (Pro feature)Category-Based
Custom Taxonomy Name (Pro)Applies based on a custom taxonomy (Pro feature)Category-Based

Comparison Methods

Text-Based Comparisons

Applies to: Product Title, Product Description, Meta Fields

  • Is exactly
  • Is exactly (case-insensitive)
  • Is not exactly
  • Is not exactly (case-insensitive)
  • Contains
  • Contains (case-insensitive)
  • Does not contain
  • Does not contain (case-insensitive)

Category & Taxonomy-Based Comparisons

Applies to: Category Names, Tag Names, Brand Name, Custom Taxonomy

  • 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 string
  • Do 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 string
  • Do not include any containing (case-insensitive)

Numeric Comparisons

Applies to: Days Since Created, Days Since Modified, Stock Quantity, Price, Total Sales, Meta Fields

  • Is exactly
  • Is not exactly
  • Greater than
  • Greater than or equal to
  • Less than
  • Less than or equal to
  • Between
  • Not 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 3 would apply, while a rule with equal to 3 would not.

This ensures precise comparisons but also means that manual edits to product timestamps may affect rule execution. Reference: WooCommerce WC_DateTime Class

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 FieldDescription
_skuProduct SKU (Stock Keeping Unit)
_priceCurrent product price
_regular_priceRegular price (without discounts)
_sale_priceSale price (if applicable)
_stockCurrent stock quantity
_stock_statusStock availability (instock, outofstock, onbackorder)
_manage_stockWhether stock management is enabled (yes or no)
_sold_individuallyWhether the product is sold individually (yes or no)
_downloadableWhether the product is downloadable (yes or no)
_download_limitNumber of times a file can be downloaded
_download_expiryExpiration date for downloads
_downloadable_filesList of downloadable file links
_virtualWhether the product is virtual (yes or no)
_wc_average_ratingThe product's average customer rating
_wc_review_countThe total number of reviews for the product
_tax_classThe tax class assigned to the product
_tax_statusThe tax status (taxable, shipping, none)
_thumbnail_idThe ID of the product's main image
_product_attributesSerialized data for product attributes
_product_image_gallerySerialized list of additional product images
_product_urlExternal product URL (for affiliate products)
_product_versionThe version of the product
_button_textCustom button text for external/affiliate products
_childrenStores child product IDs (for grouped products)
_edit_lastThe last user who edited the product
_edit_lockTimestamp for post lock editing
_wc_total_salesTotal sales count for the product
_backordersWhether backorders are allowed (yes, no, or notify)
_wp_old_dateStores the previous post date
_wp_old_slugStores the previous product slug
_wpcom_is_markdownDetermines 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.