Documentation menu Conditions

Rules

Conditions

WHEN operators that decide when a ContentGuard rule applies.

WHEN conditions decide when a ContentGuard rule applies. They compare a field value with an operator (and, for most operators, an operand). After every WHEN condition matches, ContentGuard evaluates the rule’s THEN validations—or, for condition-only rules, treats the match itself as the finding.

Empty WHEN

Leave WHEN empty to apply the rule to every post of the selected type. The rule then runs its THEN validations unconditionally.

A rule still needs at least one WHEN condition or one THEN validation.

Operators

OperatorTypical builder labelBehavior
equalsis / is equal toExact comparable-string match
not_equalsis not / is not equal toValue differs from the operand
is_emptyis emptyField has no value
is_not_emptyis not emptyField has a value
containscontainsCase-insensitive literal substring
does_not_containdoes not containSubstring is absent
greater_thanis greater thanNumeric comparison
greater_than_or_equalis at leastNumeric comparison
less_thanis less thanNumeric comparison
less_than_or_equalis at mostNumeric comparison

Available operators depend on the selected field type in the Rule Builder.

Equals and not equals

Equality uses ContentGuard’s comparable string form (scalars only). Empty values equal other empty values. Non-scalar values do not compare as equal.

Empty and not empty

Empty means null, false, '', or []. Integer 0 and string "0" are not empty.

Contains and does not contain

These are WHEN-only operators—not THEN validators. They perform case-insensitive literal substring matching on string-like fields (for example text, textarea, WYSIWYG/Content, email, URL, single select, radio, button group).

  • No regex, wildcards, fuzzy matching, or AI interpretation
  • Empty field values never match contains
  • Empty search operands are invalid and never match
  • does_not_contain is the inverse of contains

Numeric comparisons

Greater than / less than (and their or-equal variants) apply to number and range fields. Date and date/time fields support equals, not equals, empty, and not empty—not numeric comparisons.

AND-only behavior

Multiple WHEN conditions use AND logic in V1. Every listed condition must match for the rule to apply. There is no OR grouping.

Condition-only rules

A rule can have WHEN conditions and no THEN validation. When the conditions match, the rule itself becomes the finding. With Blocking severity, that match prevents publishing (and updates to published/private content on supported paths) until the content no longer matches.

Restricted terminology

Applies to: Posts

Blocking
WHEN
Content contains "healthy"
THEN
No validation needed
Rule preview

When Content contains "healthy", this rule blocks publishing.

This is a user-defined governance rule—not a built-in dictionary of banned words.

Condition-only rule: WHEN Content contains “healthy”, Blocking — no THEN validation required.

Repeated fields

WHEN conditions on Repeater and Flexible Content fields use any-row semantics: the condition matches if any applicable row or layout instance meets it. See Repeater Behavior.

Limitations

  • No OR logic between conditions
  • No regex, wildcards, fuzzy, or AI matching
  • contains / does_not_contain are not available as THEN validators
  • Numeric comparisons are limited to number and range fields
  • Cross-field formulas and cross-row logic are outside V1