# Email

> An email address. Invalid ones are dropped when saving.

Source: https://uglydev.com/field-types/email/
Updated: 20 November 2026

**When to use it.** An email address. It is checked when saved, so a wrong one is dropped instead of stored.

**What the editor sees.** A single-line box that checks the format.

![The Email field on an edit screen](https://uglydev.com/wp-content/uploads/2026/11/shot-email-1.webp)

*The Email field on an edit screen.*

|  |  |
| --- | --- |
| **Name in files and code** | `email` |
| **`ugly_get()` gives** | Text. |
| **Behavior** | can be required; can share a line with other fields |

**Settings**

| Setting | What it does | Default |
| --- | --- | --- |
| **Placeholder** | Gray text shown while the field is empty. | (empty) |

**In your theme**

```php
<?php $email = ugly_get( 'contact_email' ); ?>
<?php if ( $email ) : ?>
	<a href="mailto:<?php echo esc_attr( antispambot( $email ) ); ?>">
		<?php echo esc_html( antispambot( $email ) ); ?>
	</a>
<?php endif; ?>
```

**Good to know**

- An invalid address is dropped when saving, not stored as typed.
- `antispambot()` is WordPress' own function to make the address harder for robots to read.
