
Prefilling a Contact Form 7 field can save a visitor from typing information the page already provides. A product inquiry can start with a product name; a service page can suggest a service. The useful question is not simply whether a value appears. It is whether that value remains understandable, editable where appropriate, and reliable enough for the workflow that receives it.
This guide explains visible defaults and contextual defaults, then gives you a release checklist for reporting and lead handling. The examples use synthetic service names. They are configuration examples, not results from a test of your site.
Choose between a starting value and a hint
A default value is actual field content. A visitor may submit it without changing it. A placeholder is a hint displayed while a field is empty; it does not supply an answer. Contact Form 7 documents both behaviors in its text-field reference.
<label>Service you are asking about
[text service "Website maintenance"]
</label>
<label>Your email address
[email* your-email placeholder "[email protected]"]
</label>
The service starts with a value. The email starts empty and remains required. Keep a visible label in both cases: a disappearing hint cannot explain a filled field. Avoid prefilling consent, an agreement, or an answer that must reflect an independent choice. A convenient starting point should not imply that the visitor actively selected it.
Use page context when a static default is too broad
Contact Form 7’s contextual default documentation supports sources such as GET parameters and post custom fields. The field name must correspond to the relevant source key. A simple query-driven example is:
<label>Service you are asking about
[text service default:get]
</label>
A link to /request/?service=Website%20maintenance can provide the initial service value. Replace the example path with the page that contains your form. Encode query values correctly when building links, and test the final URL rather than assuming a link builder preserved spaces and punctuation.
Use this approach for harmless descriptive context. URLs may be copied, logged, bookmarked, or forwarded. Do not put a person’s email address, private account information, or access token into a prefill link. A query parameter is visitor-controlled input, even when your own button originally created it.
Define a deliberate fallback order
The documented default sources are evaluated from left to right until a nonempty value is found. You can combine a query value, a post custom field with the same name, and a literal fallback:
[text service default:get default:post_meta "General inquiry"]
Write down what each branch means. For this example, a supplied query value wins; otherwise page metadata can suggest the service; otherwise the form says General inquiry. That is a display rule, not a rule for authorization or pricing. Never use the visible result as proof that a visitor qualifies for an offer or owns a particular account.
A page-level default is useful when several pages share one form definition. It is less appropriate when the default changes per visitor and a cache might serve a shared page. Check your actual cache behavior in staging. If the final rendered HTML contains a person-specific value, review whether that response can be reused for another visitor before enabling it publicly.
Keep the destination mapping explicit
A field that looks correct on screen can still be missing from the notification or connected record. Use the corresponding mail-tag, such as [service], in the intended notification body. Contact Form 7 explains this separate mapping in Setting up mail. Check any CRM or automation mapping independently; a form-tag does not automatically establish a connector contract.
For reporting, decide whether you want the visitor’s final answer, the original page context, or both. An editable service field represents the final answer. It cannot prove which page suggested the initial value. If your workflow needs both dimensions, design and validate separate fields rather than reconstructing provenance from the answer later.
Keep category values small and stable. “Maintenance,” “Migration,” and “General” are easier to group than arbitrary sentences entered through a URL. A receiving workflow can map known values to categories and send unknown values to a review bucket. Do not silently treat every unfamiliar value as a new service, and do not use a reporting category as an instruction to execute an action.
Test the states that change the meaning
| Scenario | What to inspect | Expected decision |
|---|---|---|
| No query parameter | Initial field and final destination | The intended fallback appears and maps consistently. |
| Known service parameter | Decoded text, label and saved answer | The suggested service is readable and editable. |
| Empty or unexpected parameter | Fallback and destination classification | Unknown context does not trigger a privileged action. |
| Visitor changes the value | Notification and connected record | The final answer is preserved instead of the initial suggestion. |
| Shared or cached page | Two independent browser sessions | One visitor’s private context is never reused for another. |
Perform submission checks in an authorized staging environment with synthetic data and a controlled mail destination. Include a mobile browser and keyboard navigation. Refresh the page, follow a different service link, and use browser back navigation. These paths can reveal stale values that a single clean page load misses.
Troubleshoot a missing or surprising value
First compare the field name with the query key or post custom-field key. Then inspect the actual link and the page on which the form renders. A custom field stored on a different post is not necessarily the context you expected. Temporarily simplify to one source in staging so you can distinguish a missing source from a fallback that masked it.
If you need values supplied directly through shortcode attributes, read the separate shortcode-attribute default guide. It requires explicit attribute registration; adding an arbitrary attribute to a shortcode is not the same as enabling default:get. Keep that customization narrow and document who maintains it.
Review trends after the mapping is stable
Start with a small set of known answers, verify the receiving records, and only then interpret submission trends. Our Contact Form 7 analytics guide explains the reporting context. Svetlik Analytics for Contact Form 7, our free plugin, provides submission statistics in WordPress. Its statistics do not independently prove the correctness of your prefill or destination mapping.
A good prefill reduces work without hiding a decision. Keep the label clear, let visitors correct descriptive values, and preserve the distinction between suggested context and the answer they actually submit.
Sources
Official references checked October 6, 2026: CF7 text fields, contextual defaults, shortcode defaults, and mail configuration.
