Skip to content
themeforge
EN
Start free
Menu
  1. Home
  2. Attribute reference
  3. wp-field
Core Forms and plugins

A form field with a stable key

wp-field="key"

Without wp-field, a form field reaches the entry under its label from the design. Rename “Your name” to “Name”, and an email template with {{ Your name }} or a CRM mapping silently gets nothing, while entries keep arriving. wp-field fixes the key.

Where it goes

On the field itself or on its “label + field” wrapper. The value is a key in Latin letters: name, phone, guests.

The build writes the key into the field’s name and data-name; nothing in the theme changes.

Example: a booking form

Markup contacts.html
<form class="form">
  <label wp-field="name">Your name
    <input type="text" name="field" data-name="Your name"></label>
  <label wp-field="phone">Phone
    <input type="tel" name="field" data-name="Phone"></label>
  <input type="submit" value="Send">
</form>
In the admin Form entries
Form entries → Entry #128
  • name: Anna Kowalski
  • phone: +1 (555) 010-0142
On the site contacts page

Your name

Phone

Send

In the entry the fields are named by keys, not by their label text.

What matters

  • Use the key in the email template and the delivery settings: {{ name }}.
  • The attribute is optional: without it the form works by labels, as before.
  • For comments, reviews and checkout WordPress sets the field names itself; do not add wp-field there.

Common mistakes

The build log is the “Logs” tab of your project on themeforge.pro; the free markup check shows the same notes.

Not like this
<label wp-field="action">Your name
  <input type="text" name="field" data-name="Your name"></label>

A reserved name such as action, or a key in non-Latin letters: the build does not apply it, logs it, and the field is sent under its label.

Like this
<label wp-field="name">Your name
  <input type="text" name="field" data-name="Your name"></label>

Your own key in Latin letters.

Used in recipes

Ready when you are

See your site’s WordPress admin before you pay.