WordPress hidden fields

WordPress form hidden fields, and when you can skip them

Hidden fields carry campaign data into WordPress forms, and they work. Below is the full method, then the one snippet that sources every plugin with nothing declared.

Full manual method Or one snippet Free to start
app.leadsource.co · lead record
Grace Liang
Brightwater Logistics
Channel
Organic search
Hidden fields
none declared
Landing page
/managed-it
Form
Contact form
Page journey
  1. /managed-it
  2. /pricing
  3. /contact
Salesforce
HubSpot
Pipedrive
Gmail
Google Ads
Gravity Forms
Jotform
Webflow
Wix
Typeform

WordPress hidden fields, done properly

Declare, capture, populate, test, map. The five steps, start to finish.

Every WordPress plugin, zero declarations

One snippet in the header and each submission arrives sourced. Forms untouched.

The full WordPress visit, attached

Organic and direct visits named, return visitors joined up, the pages read in order.

WordPress hidden fields, still useful

Record IDs, known contacts, plans and partner codes. Those jobs stay theirs.

The manual method

WordPress hidden fields, done properly

A hidden field is a named slot in your form that the visitor never sees. Add a matching parameter to the URL that opens the form, and whatever it holds rides back in the submission. It passes a value through. It never goes looking for one.

  1. Declare the fields in your form builder: utm_source, utm_medium, utm_campaign, utm_term, utm_content. The names are case sensitive.
  2. Capture the values at landing. Read the parameters as the visitor arrives and store them, so they outlive the next click. A cookie outlasts the browser session; session storage does not.
  3. Populate them on every form. Each plugin has its own way of doing this, which is why the work repeats per plugin.
  4. Test each way into the form. Every entry point stands or falls on its own, without telling you.
  5. Map the fields onward into your CRM, once per form and once per plugin.
form builder · hidden fields
Field names on the form
Field 1
utm_source
Field 2
utm_medium
Field 3
utm_campaign
What came back in the submission
utm_source
newsletter
utm_medium
email
utm_campaign
october-newsletter
per form. per plugin. names exact.
Your real code is in the dashboard
<script async src="https://app.leadsource.co/ft.js" data-site="YOUR_SITE_KEY"></script>
The snippet route

Every WordPress plugin, zero declarations

Lead Source recognises the visitor on your site and pairs the submission with them the moment it lands. Nothing is pushed into the form. So there is no field to declare, no link to extend and no mapping to repeat. Five steps become one paste. The paste is covered on the WordPress lead tracking page.

  1. Paste the tracking code into your site header. WPCode’s Header section does the job.
  2. Clear the page cache so every page serves the new code.
Start free

5-minute install · no card

Built already

Your WordPress hidden fields stay put

Hidden fields you have already wired keep doing what you built them for. Lead Source never reads them, edits them or gets in their way. It writes its attribution onto the lead, next to them. Peaceful coexistence.

Past the parameters

The full WordPress visit, attached

A hidden field holds whatever the URL handed it, and nothing more. The tracking code records the visit itself: organic, direct and referral named, a returning visitor joined to their first campaign, and the pages they read on the way. Three pricing-page reads show as three.

  • A channel on every submission, tagged or not.
  • First and last touch on the same lead.
  • A form published tomorrow is covered on publish.
app.leadsource.co · lead record
Grace LiangContact form
First touchReferral/managed-it
Last touchOrganic search/pricing
Page journey
  1. /managed-it
  2. /pricing ×3
  3. /contact
wordpress form · values you pass in
Set by you, on the link
record_id
7730
product
cyber-security-audit
location
north-shore
affiliate
okafor-12
none of this is attribution. all of it stays.
The right tool

WordPress hidden fields, still useful

Attribution is one job a hidden field can do. For these others it stays the correct choice, and Lead Source replaces none of them. Run both.

  • An internal record ID, so the submission lands already linked to its account.
  • A known email, pre-filled on a form sent to an existing contact.
  • A product, plan or location, so one form covers several contexts.
  • A partner or affiliate code that you issued.

How do I add hidden fields to a WordPress form?

Declare a field per UTM in the form builder, store the URL parameters when someone lands, and populate them on every form. Each plugin does that part its own way. Then test every entry point and map the fields into your CRM.

What can a WordPress hidden field carry?

Only a value that was on the URL. Untagged visits from search, bookmarks and other sites bring none, so those fields come back blank. A visitor whose storage cleared before they returned comes back blank too, and no field carries the page journey. Lead Source records all three from the visit.

Common questions

WordPress hidden field questions, answered.

Why are my hidden fields empty?

Usually one of three things: the field name differs from the parameter, the link that opened the form never carried the parameter, or the visitor browsed to another page before opening the form. Check them in that order.

Do I need a different setup per plugin?

With hidden fields, yes: each plugin populates them its own way. With the Lead Source tracking code, one snippet covers every plugin on the site.

Can I use both?

Yes, and plenty of sites do. Hidden fields keep their other jobs, and Lead Source handles the source, campaign and journey alongside them.

Every WordPress form, sourced without a field.

One snippet in the header and each submission arrives with its channel, campaign and pages read. Free to start.

Start free

Free to start · no card

WordPress lead trackingIntegrations