Documentation menu Validations

Rules

Validations

THEN validators that ContentGuard evaluates after WHEN conditions are satisfied.

THEN validations decide what must be true after a rule’s WHEN conditions are satisfied. ContentGuard evaluates each validator against the applicable field value and reports a finding when a requirement fails.

WHEN vs THEN

PartRole
WHENOptional conditions that decide whether the rule applies
THENOptional validators that decide what must pass once the rule applies
SeverityBlocking or Warning when a finding is produced
  • Empty WHEN → THEN runs for every post of the selected type
  • WHEN present → THEN runs only after every condition matches
  • WHEN without THEN → condition-only rule (the match itself is the finding)
  • THEN without WHEN → unconditional validation
  • A rule needs at least one WHEN condition or one THEN validation

Validators

ValidatorBehavior
RequiredField must have a value (not empty)
Minimum lengthCharacter count must be at least the configured minimum
Maximum lengthCharacter count must be at most the configured maximum
Allowed valuesValue must be one of a configured set

Length uses ContentGuard’s string length for scalar values. Empty values have length 0. Non-scalar values cannot be measured as text.

Allowed values compare using the same equality rules as WHEN equals. An empty field passes only if the allowed set intentionally includes an empty value.

Severity

Severity is set on the rule, not per validator:

  • Blocking — Prevents publish and updates to published/private content on supported paths until the issue is resolved
  • Warning — Surfaces the finding but allows the save

Drafts, autosaves, and revisions are not blocked in V1. See Blocking vs Warning.

Conditional validation

WHEN conditions gate THEN validators. ContentGuard evaluates the requirement only after the conditions match.

Require body when titled

Applies to: Posts

Blocking
WHEN
Title is not empty
THEN
Content is required
Rule preview

When Title is not empty, Content is required.

Conditional validation: WHEN Title is not empty, THEN Content is required.

Condition-only vs validation rules

Rule shapeFinding when…
Condition-only (WHEN, no THEN)The WHEN conditions match
Validation (THEN present)A THEN validator fails after WHEN is satisfied (or immediately if WHEN is empty)

Condition-only rules are useful for prohibited terminology and similar governance checks. Validation rules enforce requirements such as required fields or length limits.

Repeated fields

THEN validations on Repeater / Flexible Content targets apply to every matching row or instance. If a Repeater has no rows, a required-style every-row validation can fail with a “add at least one row” finding. See Repeater Behavior.

Limitations

  • contains / does_not_contain are WHEN operators only—they are not THEN validators
  • No custom formula validators or cross-field calculations in V1
  • Severity applies to the whole rule