Most “broken pages” are not caused by bugs in the rendering code. They happen when content arrives in an unexpected shape: a missing title, a hero image that is too small, an empty button label, or a URL that was pasted with extra whitespace.
A CMS makes publishing fast, but it also makes it easy to publish invalid combinations of fields. Field-level validation is how you prevent those combinations in the first place, right where editors work.
This post focuses on practical, evergreen validation patterns that work in nearly any CMS. The goal is not to make editing strict for its own sake. It is to make the “happy path” obvious and safe, so you spend less time on cleanup, broken layouts, and late-night fixes.
Why broken pages happen
There are a few repeating failure modes behind most content-related incidents. They show up across marketing sites, documentation, and product catalogs.
- Required information is missing. A page is created without a headline, a publish date, or the call-to-action text that the template assumes exists.
- Formats drift. A field starts as “plain text” but later people paste in emoji, newlines, or long strings that break the design.
- References go stale. A page links to an internal item (author, product, category) that gets deleted or unpublished.
- Cross-field contradictions. An editor checks “Show promo banner” but never fills in the banner message, or selects “External link” but leaves the URL blank.
- Hidden constraints are enforced only in code. Engineers quietly build assumptions into templates, and editors only discover them after something looks wrong.
Field-level validation shifts these failures earlier. Instead of finding them in production, you surface them during entry, review, or publishing.
What field-level validation means
Field-level validation is a set of rules attached to content types and fields that determine whether content is acceptable. Depending on your CMS, rules might run while editing, on save, on publish, or in a pre-publish checklist.
Types of validation rules that matter most
You can cover most real-world issues with a small set of rule families:
- Presence rules: required fields, required at publish time, required when a toggle is enabled.
- Length rules: minimum and maximum characters, often for titles, summaries, button labels, and SEO fields.
- Format rules: slug patterns, URL patterns, email patterns (if applicable), and whitespace trimming expectations.
- Enum rules: only allow a value from an approved list (for status, layout, theme, region).
- Reference integrity rules: referenced items must exist and be published, or must be in the same locale.
- Cross-field rules: validate combinations (if X is set then Y is required; if layout is “Hero” then hero image is required).
A good validation system is not just a gate. It is documentation for how your content model is meant to be used.
A validation blueprint you can copy
If you are starting from scratch, resist the urge to validate everything. Begin with rules that prevent outages and obvious editorial rework. Then add stricter rules as the model stabilizes.
Copyable checklist: define “publishable” content
Use this checklist when creating or revising a content type. You can copy it into an internal doc or a CMS “model notes” field.
- Decide validation timing: which fields must be valid on save vs only on publish?
- Mark publish blockers: required headline, required slug, required primary image, required canonical path (if you use one).
- Set safe length limits: title max, summary max, button label max, nav label max.
- Normalize formatting: trim whitespace, forbid leading or trailing spaces, decide whether multiple spaces are allowed.
- Validate links: if a link is present, require label + URL; if internal, require referenced item; if external, require protocol.
- Constrain layout options: only allow layouts that your frontend supports; retire old layout values rather than letting them linger.
- Guard references: prevent referencing drafts when publishing, or warn when references are unpublished.
- Define error messages: write messages for editors, not developers. Mention the fix, not just the failure.
- Document intent: add a short “what this field is for” description to reduce misuse.
- Add one escape hatch: if you must, allow an override role or a “Publish with warnings” flow for urgent cases, but log it.
Small, explicit constraints make a CMS feel easier, not harder. Editors spend less time guessing what “good” looks like.
Real-world example: a product launch page
Consider a “Product Launch Page” content type used by a small team. It ships in multiple layouts: a standard hero, a minimalist hero, and a press kit variant. Without validation, it is easy to produce a page that renders but looks broken.
Here is a concrete set of rules that tends to work well:
- Title (required, 30 to 80 chars). Show a warning if shorter than 30, block publish if empty or longer than 80.
- Slug (required, lowercase, hyphens only). Auto-generate from title, but validate after edits.
- Hero layout (required enum). Only values your frontend supports.
- Hero image (required if layout != “Minimal”). If “Minimal”, hide the image field or mark it optional.
- Primary CTA label + URL (required as a pair). If label exists then URL required, and vice versa.
- Secondary CTA (optional pair). Same pairing rule, plus a shorter label limit.
- Press kit link (required if variant = “PressKit”). Make the press kit variant impossible to publish without it.
- Related products (0 to 6 references). If references exist, ensure each referenced product is published.
Notice what is not validated: the “perfect” marketing copy, subjective tone, or whether the launch is “good.” Validation should enforce structure and safety, not taste.
- Validate for publishability: the minimum structure needed to render correctly and meet your team’s workflow.
- Start with presence, pairing, enums, and reference integrity. These prevent the majority of broken pages.
- Write editor-friendly errors that explain the fix, and prefer conditional validation over “always required.”
- Keep one escape hatch for urgent publishing, but make it visible and auditable.
Common mistakes
Validation is powerful, but it is easy to misuse. These mistakes typically create more friction than quality.
- Making everything required. Editors end up adding placeholder text just to publish, and placeholders sometimes ship.
- Blocking drafts from being saved. Saving is how people collaborate. Prefer “block publish” for many rules, not “block save.”
- Encoding design quirks as permanent rules. If a template breaks at 81 characters, fix the template. Do not force content to stay unnaturally short forever.
- Unclear error messages. “Invalid value” is not actionable. “CTA URL is required when CTA label is filled” is actionable.
- Ignoring migrations. When you add new rules, existing content may fail validation. Plan a cleanup pass or an incremental rollout.
- Validating in two places inconsistently. If the CMS allows something but the frontend rejects it, you create confusion. Align the rules.
When not to add validation
Not every annoyance deserves a hard rule. Over-validation can slow publishing and push people into workarounds.
- Early exploration. If a content type is still experimental, use gentle warnings and documentation before you lock it down.
- Highly variable content. Some pages are intentionally flexible. Instead of strict rules, provide recommended ranges and examples.
- One-off campaigns. If a content type will be used once and then retired, validation may not pay back. Put effort into a review checklist instead.
- Purely aesthetic preferences. Enforcing brand voice, headline cleverness, or “good writing” is better handled by editorial review.
A helpful framing is: add validation when failure causes broken rendering, broken navigation, broken accessibility, or repeated human rework.
Implementation notes (without tying to one CMS)
Most CMS platforms support some mix of field constraints, custom validators, and workflow states. If you are designing the rules, treat them like a small product.
First, define a simple “contract” for each content type: which fields are required at publish time, which are optional, and what values are allowed. Then decide which rules are errors and which are warnings.
A concise way to communicate the contract across editors and developers is a tiny spec. It does not need to be code, but it should be explicit enough to implement consistently.
{
"contentType": "LaunchPage",
"publishBlockers": [
{"field": "title", "rule": "required"},
{"field": "slug", "rule": "matches: ^[a-z0-9]+(-[a-z0-9]+)*$"},
{"rule": "if heroLayout != 'Minimal' then heroImage is required"},
{"rule": "ctaLabel and ctaUrl must be provided together"}
],
"warnings": [
{"field": "title", "rule": "minLength: 30"},
{"field": "summary", "rule": "maxLength: 160"}
]
}
Finally, think about feedback placement. Validation is most effective when it appears near the field, with a message that explains what to change. A single red banner at the top of the page is easy to ignore and hard to act on.
Conclusion
Field-level validation is one of the highest leverage improvements you can make to a CMS setup. It prevents broken pages by enforcing structural expectations where content is created, not where it is rendered.
Start with a small set of publish blockers, focus on cross-field pairing and reference integrity, and write messages that make sense to editors. You will ship faster, with fewer surprises, and with a content model that stays understandable as it grows.
FAQ
Should validation be warnings or hard errors?
Use hard errors for rules that prevent correct rendering or navigation, such as missing required fields, invalid slugs, and broken references. Use warnings for recommendations like “ideal title length” or optional fields that improve quality but are not strictly necessary.
Where should validation run: in the CMS, in the frontend, or both?
Prefer the CMS as the source of truth so editors get fast feedback. Keep a lightweight safety net in the frontend for defensive programming, but avoid introducing separate rules that disagree with the CMS.
What if existing content fails when we add new validation?
Roll out in phases: start as warnings, then clean up old entries, then turn blockers on for publishing. If you need an immediate change, consider applying strict validation only to newly created items or only at publish time.
How strict should slug validation be?
Strict enough to guarantee stable URLs and predictable routing. A common choice is lowercase letters and numbers with hyphens, no leading or trailing hyphen. If you support multiple locales or special characters, decide on a consistent transliteration approach and document it.