
A visitor pastes an email address from a document, adds a space after it, and receives a validation error. Another enters only spaces in a required field. These look like small input problems, but they can reveal different rules in the browser, Contact Form 7, an extension and the system receiving the inquiry. Diagnose the exact boundary before adding a script that rewrites every answer.
This guide explains the documented CF7 whitespace policy and a practical way to check your own installation. The examples are synthetic and the procedure is proposed verification, not a report of tests performed on your site.
Understand surrounding whitespace first
Surrounding whitespace sits before or after meaningful content. Internal whitespace sits between words or inside a message. Removing the space after an address is a different operation from removing the space between a person’s first and last names.
CF7’s published validation policy says leading and trailing Unicode whitespace should be stripped before validation, across field types and rules. That makes a whitespace-only required answer empty for validation and permits surrounding whitespace around an otherwise valid email address. The 6.0 release notes identify consistent surrounding-whitespace handling in its bundled validation update. These are established changes, not a newly announced feature.
Do not turn that policy into a claim that every invisible character is removed. A character that looks blank may not belong to the same Unicode whitespace set. Nor does the policy promise to remove punctuation, correct a misspelled address or preserve a particular extension’s output.
Separate validation from downstream values
The current upstream submission implementation sanitizes posted values and strips surrounding whitespace before later processing. Extensions can then filter values. That source is a moving development reference; compare it with the version actually installed before depending on implementation details.
For a real workflow, write down four observations separately: what the input displays, whether validation accepts it, what the notification contains and what an enabled storage or connector destination records. Agreement at one boundary does not establish agreement everywhere. An email preview cannot prove what a CRM connector sent, especially if the connector applies its own transformation.
Build a small reproduction matrix
Start with a staging copy and a plain required text field plus an email field. Record the CF7 version, active extensions, browser and page URL. Preserve the original form configuration so one deliberate change can be reversed without restoring the entire site.
<label>Your name
[text* your-name]</label>
<label>Email address
[email* your-email]</label>
[submit "Send inquiry"]
Use the form-tag generator where possible, then confirm that the matching mail-tags are present in the Mail template. Keep the ordinary working configuration unchanged while establishing the baseline.
- Enter an ordinary synthetic name and an address belonging to your controlled test mailbox.
- Repeat with one ordinary space before and after each value.
- Enter only ordinary spaces in the required name field.
- Paste a known nonbreaking-space example, documenting the exact character rather than calling it simply invisible.
- Enter a two-word name and a message with intentional internal spacing and line breaks.
Record expected versus actual validation for each case. Send notifications only through a controlled environment when checking the full path. A browser-only inspection of an empty field is enough to observe some validation behavior, but does not verify mail or storage.
Find the layer causing disagreement
If the standard form works but the production form rejects a pasted value, compare field types and custom rules first. An email address placed in a text field and validated by a separate script may follow different rules. Likewise, a custom validation callback may examine raw request data rather than CF7’s processed value.
Check the browser console for an earlier JavaScript error, then inspect the request and its response in a controlled test. Distinguish a field validation response from a blocked request or a mail failure. The browser diagnostics comparison explains useful tools for those observations. Do not publish request bodies containing real customer answers in a support ticket.
When behavior differs across versions, reproduce it with the documented supported configuration before considering an update. Plan updates through your normal staging process. Do not downgrade a live plugin merely to restore a permissive input check.
Avoid broad cleanup that changes meaning
A global replace-all-spaces rule can damage names, postal addresses, reference codes and free-text messages. Even trimming can be inappropriate for a field whose contract deliberately preserves exact leading or trailing content. Decide the business rule per field, then apply it consistently at the authoritative processing layer.
Explain any restriction beside the field in ordinary language. For an identifier, show the expected format and give an actionable error. For an open message, avoid imposing an identifier’s cleanup rule. If your team adds custom validation, use the narrow validation guide and retain examples that previously failed as regression cases.
Close the loop with useful evidence
A good repair record contains the affected field, exact synthetic input, expected outcome, installed versions, changed rule and verified destinations. It should also include an internal-space example that still works. This makes it possible to distinguish a corrected paste problem from accidental loss of meaningful content.
Submission statistics can help your team review activity after a change, but cannot explain every rejected character. For ongoing trends, consider the free Svetlik Analytics for Contact Form 7. Keep those aggregate observations alongside the form testing checklist; do not treat a count change as proof that whitespace handling improved.
Sources
Reviewed October 22, 2026: CF7’s surrounding-whitespace policy, 6.0 release notes and current submission source. Verify your installed version and extension behavior before adopting an implementation-specific change.
