Rules
Creating Your First Rule
Create your first ContentLatch rule in the Rule Builder—set WHEN conditions, THEN validations, Blocking or Warning severity, and test it in the editor.
The rule model
Every ContentLatch rule targets a post type and uses the same structure:
- WHEN — optional conditions that decide when the rule applies
- THEN — optional validations that decide what must be true
- Severity — Blocking or Warning
A rule needs at least a WHEN condition or a THEN validation. Multiple WHEN conditions use AND logic in V1. Leave WHEN empty to apply the rule to every post of the selected type.
Example 1: Condition-only rule
This is a user-defined governance rule—not a built-in dictionary of banned words.
Restricted terminology
Applies to: Posts
- WHEN
- Content contains "healthy"
- THEN
- No validation needed
When Content contains "healthy", this rule blocks publishing.
What this means
- Open ContentLatch → Rules → Add New Rule.
- Name the rule and set Applies to (for example, Posts).
- Under WHEN, choose the Content field, operator contains, and value
healthy. - Leave THEN without a validation (condition-only).
- Set severity to Blocking.
- Save the rule and keep it Active.
When Content contains the configured term, the rule itself becomes the finding. With Blocking severity, publishing (and updates to published/private content on supported paths) is prevented until the content no longer matches.
contains is a case-insensitive literal substring match. It is not regex, wildcard, fuzzy, or AI matching. Empty search values are invalid.
Example 2: WHEN + THEN validation
Require body when titled
Applies to: Posts
- WHEN
- Title is not empty
- THEN
- Content is required
When Title is not empty, Content is required.
Build it
- Applies to — choose the post type.
- WHEN — Title · is not empty.
- THEN — Content · Required.
- Severity — Blocking or Warning.
- Save.
ContentLatch evaluates the THEN requirement only after the WHEN conditions are satisfied.
Testing a rule
- Edit a post of the target type in Classic Editor or the block editor.
- Enter content that should fail the rule.
- Attempt to publish (or update published/private content).
- Confirm the outcome: in the block editor, Core Blocking surfaces through the editor/REST presentation with ContentLatch · Blocking; Classic Core Blocking interrupts the save before persistence (it does not show an inline Classic Blocking notice); Warning findings can appear in-editor without blocking the save; ACF Blocking can use ACF’s inline validation.
Drafts, autosaves, and revisions are not blocked in V1. You can still save work in progress even when a Blocking rule would fail on publish.
Next steps
- Read Blocking vs Warning for severity behavior.
- See Conditions and Validations for operator and validator detail.