Last updated on : August 2, 2025
The Email field provides a single-line input specifically designed for collecting email addresses. It ensures that users enter a valid email format and is ideal for forms requiring contact details or user identification.
Settings
- Field Type: Selects the type of input field to display. The Email field creates a single-line input optimized for email addresses and validates the format.
- Field Label: The label displayed above the input field on the form. Helps users understand what type of email information to enter.
- Field Name: A unique identifier used in the database and code. Only lowercase letters, numbers, and underscores are allowed. This value is used when retrieving and saving data.
- Required Field: Forces users to fill in this field before submitting the form. If enabled, empty or invalid email addresses will not be accepted. Defaults to off.
- Default Value: Sets a pre-filled email address that appears in the input when creating new entries. Users can change this when filling out the form.
- Placeholder: Text that appears inside the input field when no value has been entered. It provides an example format such as
you@example.com
.
Template usage
// Get the value of the Email field (replace 'email_field_key' with your actual field name)
$email_field_value = get_post_meta( $post->ID, 'email_field_key', true );
// Output the value (if it exists)
if ( ! empty( $email_field_value ) ) {
echo '<p>Email: ' . esc_html( $email_field_value ) . '</p>';
}
That’s it! You’ve successfully configured an Email field. Now it’s ready to collect and validate user email addresses in your WordPress setup.