Add hidden fields

Attach your own data, like a user ID or a plan, to each submission.

A hidden field adds a value from your site, like a user ID or a plan, to every submission. People filling in the form never see hidden fields.

Add a hidden field

  1. Open your form in the editor.
  2. Click the empty space around the form, or press Esc, so no question is selected.
  3. In the Settings panel, find Hidden fields.
  4. Type a name, like user_id, and click Add.
  5. Click Publish changes.

Names use lowercase letters, numbers and _. Typing User ID adds user_id.

If a name is taken, you see Another question or hidden field uses this name.

Remove a hidden field

Click × next to the field’s name.

When a rule uses the field, the × is greyed out and says A rule uses this field. Change the rule first.

Submissions you already have keep their values.

Fill in hidden fields from your site

  1. Go to Share and click Get the code.
  2. Pick how the form shows up and copy the code.
  3. Add data-hidden- and the field’s name to the button or the <div>, with your value.
<button data-wlf-open="frm_yourform" data-hidden-user_id="42">Send feedback</button>
<script src="https://wlforms.com/embed.js" async></script>

Optional: set values from your own code.

WeLoveForms.open("frm_yourform", {
  hiddenFields: { user_id: "42", plan: "pro" },
});

Optional: add values to a link you share, like https://wlforms.com/form/frm_yourform?user_id=42.

Values in your page’s address, like ?utm_source=newsletter, fill hidden fields with the same name. Values you set yourself have priority.

See hidden fields with each submission

  • Inbox: open a submission. Hidden fields sit under the answers. Details shows the Page the form was on and the Browser, like “Chrome on Mac”.
  • Export CSV: one column for each hidden field, then Page and Browser.
  • Webhooks: hidden_fields, page_url and browser.

A hidden field you add later shows up in new submissions only.

Limits

  • Up to 50 hidden fields per form.
  • Up to 2,000 characters per value. Longer values are cut.
  • Values for names your form doesn’t have are dropped.

People can change these values in their own browser, so don’t use them to decide what someone is allowed to do.

esc