Rules
Creating Your First Rule
Build a WHEN / THEN rule, choose severity, and see how ContentGuard evaluates content.
The rule model
Every ContentGuard 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 ContentGuard → 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.
ContentGuard 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 editor shows ContentGuard · Blocking or ContentGuard · Warning with the field finding.
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.