All condition rules
Snipfire has 16 rules; Snipfire Pro adds 11 more. They're listed here in the order of the rule picker. Rules marked Pro need Snipfire Pro. How rules combine is explained in Conditions.
Visitor
Is logged in
Whether the visitor is logged in. Choose yes or no.
Example: show a "Log in for member prices" note only to logged-out visitors: Is logged in no.
User role
The logged-in user's role (Administrator, Editor, Shop manager, Customer…). Operators: is / is not (any of the roles you pick). Logged-out visitors have no role.
Example: an HTML snippet in the site footer with a "Staff: open the order dashboard" link, shown only when User role is Shop manager.
User rules need WordPress to know the user, so on a PHP snippet choose plugins_loaded or later under Where (not Run immediately).
Device
Mobile or Desktop, using WordPress's own detection (wp_is_mobile()), which counts tablets as mobile. Operators: is / is not.
Example: load a chat widget on desktop only.
Tip: for layout differences, CSS media queries are more reliable than a device rule, and they work with page caching.
Query parameter (utm_…)
A parameter in the page address, such as ?utm_source=facebook or ?ref=partner. Enter the parameter name, then the value. Operators: exists, does not exist, equals, does not equal, contains (not case-sensitive).
Example: a welcome banner for newsletter readers: Query parameter utm_medium equals email.
The parameter only exists on the page the visitor lands on. To remember it on later pages, set a cookie in a snippet and use the Cookie rule.
Cookie
A browser cookie. Enter the cookie name, then the value. Operators: exists, does not exist, equals, does not equal, contains.
Example: hide a promo bar after the visitor dismissed it: Cookie promo_closed does not exist.
Country Pro
The visitor's country as a two-letter code: GR, CY, DE… Operators: is / is not (any of the codes you enter).
Snipfire reads the country from your CDN or host, with no outside lookup service:
- Cloudflare's
CF-IPCountryheader (turn on "IP Geolocation" in Cloudflare), CloudFront, Fastly, Kinsta and other hosts' country headers, or the server's GeoIP module. - Otherwise WooCommerce geolocation, if it's set up with its MaxMind database.
If the country is unknown, the rule doesn't match, with either is or is not.
Example: a Greek-language shipping note: Country is GR, CY.
Developers can supply the country themselves with the snipfire_visitor_country filter.
Region (EU, continent) Pro
The Visitor region rule: a group of countries, so you don't have to type every code. Operators: is / is not (any of the regions you pick).
| Region | Countries |
|---|---|
| European Union | The 27 EU countries |
| European Economic Area (EU, Iceland, Liechtenstein, Norway) | The EU plus Iceland, Liechtenstein and Norway |
| GDPR countries (EEA, UK, Switzerland) | The EEA plus the United Kingdom and Switzerland, which have GDPR-style laws |
| Africa, Antarctica, Asia, Europe, North America, Oceania, South America | The continent. Snipfire follows the grouping most geolocation services use: Cyprus and Russia count as Europe, Turkey and the Caucasus as Asia |
The region is worked out from the visitor's country, read the same way as for Country above. If the country is unknown, the rule doesn't match, with either is or is not.
Example: a cookie notice only for visitors covered by GDPR: Visitor region is GDPR countries (EEA, UK, Switzerland).
Like Country, it varies per visitor: see Conditions and page caching.
Referrer (came from) Pro
The address of the page the visitor came from. Operators: contains, does not contain, equals (the whole address), does not equal, starts with, matches regex.
Example: a discount for visitors from a partner's site: Referrer contains partner-site.gr.
Browsers often send only the domain (https://www.google.com/), and nothing at all for bookmarks, typed addresses and many apps. Use contains with a domain rather than equals.
Cookie consent given Pro
Whether the visitor has accepted a cookie category in your consent banner: Statistics, Marketing, Preferences or Functional. Operators: any of / none of.
It's checked on the server, from your consent tool, so it applies from the next page view after the visitor accepts. It's meant for PHP snippets. For JavaScript and HTML snippets, use the snippet's Cookie consent setting instead: it runs them the moment the visitor accepts, and works with page caches. See Cookie consent.
Page
These rules need WordPress to know which page it's showing, so they work on front-end locations from wp onwards (all HTML, CSS and JavaScript front-end locations qualify). See Conditions and timing.
Page type
What kind of page is being shown. Operators: is / is not (any of the types you pick).
| Page type | Matches |
|---|---|
| Front page | The site's home page |
| Blog (posts page) | The page listing your latest posts |
| Any single post/page | Any single post, page, product or custom post |
| Single post | A single post (not a page) |
| Page | A page |
| Attachment | An attachment page |
| Any archive | Any listing: categories, tags, authors, dates, custom post type archives |
| Category archive / Tag archive / Custom taxonomy archive | That kind of listing |
| Author archive / Date archive | That kind of listing |
| Search results | The search results page |
| 404 page | "Page not found" |
| WooCommerce: shop | The shop page |
| WooCommerce: product | A single product |
| WooCommerce: product category | A product category listing |
| WooCommerce: cart / checkout / my account | Those pages |
| WooCommerce: order received (thank you) | The page after a completed order |
The WooCommerce types are only shown when WooCommerce is active.
Example: a conversion tag on the thank-you page only: Page type is WooCommerce: order received (thank you).
Post type
The post type being viewed: Posts, Pages, Products or any public custom post type. Works on single items and on the post type's archive. Operators: is / is not.
Example: reading-time CSS for blog posts only: Post type is Post.
Post / page ID
Specific posts, pages or products by ID. Separate several IDs with commas or spaces. Operators: is / is not.
Example: a form script only on the contact page: Post / page ID is 42.
Find an ID in the admin: hover over the item in the list; the edit link contains post=42.
Taxonomy term
Posts in a category, tag or other taxonomy, or that term's archive page. Enter terms as taxonomy:slug, for example category:news, post_tag:featured or product_cat:shoes. Operators: is / is not.
On a single post it matches the terms assigned to that post; on an archive, the term being listed. It doesn't include parent or child terms automatically: list each one you need.
Example: a size-guide link on shoes: Taxonomy term is product_cat:shoes.
URL
The address of the current request (path and query string, without the domain). Operators: contains, does not contain, equals, does not equal, starts with, matches regex. Not case-sensitive.
- equals compares paths loosely:
/about,/about/andhttps://example.com/about/are the same. - matches regex takes a regular expression without delimiters, for example
^/shop/(shoes|bags)/.
Example: everything under the help section: URL starts with /help/.
Request type
What kind of request WordPress is handling: Front end, Admin area, Login page, REST API, AJAX or Cron. Operators: is / is not.
Example: a PHP snippet that should never run during cron jobs or REST requests: Request type is not Cron, REST API.
Language Pro
The current language with WPML or Polylang, otherwise the site language. The picker lists your site's languages. Operators: is / is not.
Example: a Greek cookie notice on Greek pages only: Language is Ελληνικά.
WooCommerce Pro
These rules appear when WooCommerce is active. Snippets that use them keep their rules if WooCommerce is switched off; the rules are marked (not active) and don't match.
Cart rules need a front-end location from wp onwards, because WooCommerce loads the cart late. All of them vary per visitor, so read Conditions and page caching.
Cart subtotal
The cart's subtotal as shown in the cart: products only, before shipping and coupons, with or without tax per your WooCommerce settings. Operators: is at least, is less than, equals. A decimal comma is fine (49,99).
Example: a free-shipping nudge: Cart subtotal is less than 50 AND Items in cart is at least 1.
Items in cart
The total quantity in the cart. Operators: is at least, is less than, equals.
Cart contains product
Product or variation IDs. A product ID also matches any of its variations. Operators: any of / none of.
Example: a cross-sell for customers with the camera but not the case: Cart contains product any of 120 AND Cart contains product none of 135.
Cart contains category
Product category slugs, for example shoes. A parent category also matches products in its subcategories. Operators: any of / none of.
Customer bought product
Product IDs the logged-in customer has bought, from processing and completed orders. Guests have never bought anything. Operators: any of / none of.
Example: a "How's your coffee machine?" message for people who bought it: Customer bought product any of 88.
Customer's paid orders
How many paid (processing or completed) orders the customer has. Guests count as 0, so is less than 1 means first-time buyers. Operators: is at least, is less than, equals.
Example: a welcome discount for first-time buyers: Customer's paid orders is less than 1.
Date & time
Dates and times use your site's time zone (Settings → General → Timezone).
Date range
Between two dates (and optional times). Leave one end empty for "from" or "until". The end date includes the whole day.
Example: a Black Friday banner: from 2026-11-27 to 2026-11-30.
Time of day
Between two times, HH:MM. Ranges past midnight work: 22:00 to 06:00.
Example: a "We're closed, we'll reply in the morning" note on the contact page after hours.
Day of week
Monday to Sunday. Operators: is / is not.
Site
Environment
The site's environment type: Production, Staging, Development or Local. WordPress reads it from WP_ENVIRONMENT_TYPE in wp-config.php; many hosts set it on staging copies. Without it, WordPress assumes production.
Example: keep analytics off staging: Environment is Production.
Plugin is active
Whether another plugin is active, by its folder name, for example woocommerce or wordpress-seo. Operators: is / is not.
Example: a snippet that customises Yoast SEO, set to run only while Yoast is active: Plugin is active is wordpress-seo.
Find a plugin's folder name in wp-content/plugins/, or in the plugin's WordPress.org address.
Something unclear or missing? Tell us