# How to enable email validation field

**URL:** <https://community.hivepress.io/t/how-to-enable-email-validation-field/17604>\
**Category:** HivePress\
**Tags:** code\
**Created:** [April 23, 2026, 4:48am UTC](https://community.hivepress.io/t/how-to-enable-email-validation-field/17604 "2026-04-23T04:48:41Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![kseniia](https://community.hivepress.io/user_avatar/community.hivepress.io/kseniia/32/13513_2.png) [@kseniia](https://community.hivepress.io/u/kseniia)\
**Post date:** [April 23, 2026, 3:04pm UTC](https://community.hivepress.io/t/how-to-enable-email-validation-field/17604/3 "2026-04-23T15:04:35Z")

</div>

Hi,

I believe there may be a small misunderstanding.

The Regex option is available only for Text attributes, so it cannot be applied to an Email attribute.

Additionally, the email field used in the registration or sign-in form is a built-in field, so it can’t be controlled or modified by creating a custom Email-type attribute.

If you’d like to apply specific validation rules to the email used during registration, this would require a code snippet. You can try the solution from this topic and adjust it to your needs [[How to add custom code snippets - HivePress Help Center](https://help.hivepress.io/article/23-how-to-add-custom-code-snippets)]: [Restrict sign-up to only specific domains - #4 by kseniia](https://community.hivepress.io/t/restrict-sign-up-to-only-specific-domains/17260/4)

Or use this one with your adjustments:

```auto
add_filter(
    'hivepress/v1/forms/user_register/errors',
    function ( $errors, $form ) {
        $email = $form->get_value( 'email' );

        if ( $email && ! preg_match( '/(?=.*\d)(?=.*[A-Za-z])(?=.*[!@#$%])/', $email ) ) {
            $errors[] = 'The email should contain at least one big letter, one small letter, and a special character';
        }

        return $errors;
    },
    1000,
    2
);

```

Hope this helps

---

_[View the full topic](https://community.hivepress.io/t/how-to-enable-email-validation-field/17604)._
