# How to use email address as username

**URL:** <https://community.gravityforms.com/t/how-to-use-email-address-as-username/6313>\
**Category:** Get Help\
**Tags:** gform\_user\_registration, email-address, username\
**Created:** [September 30, 2020, 11:14pm UTC](https://community.gravityforms.com/t/how-to-use-email-address-as-username/6313 "2020-09-30T23:14:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5c0166073a6c48.6](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/user5c0166073a6c48.6/32/17391_2.png) [@user5c0166073a6c48.6](https://community.gravityforms.com/u/user5c0166073a6c48.6)\
**Post date:** [September 30, 2020, 11:14pm UTC](https://community.gravityforms.com/t/how-to-use-email-address-as-username/6313/1 "2020-09-30T23:14:24Z")

</div>

It would seem that usernames are required in order to use the user registration add on. I am planning on allowing people to only login with their email address and password. While attempting to create a new account, I was told usernames can only be lowercase and contain letters a-z. So the @ sign in an email address does not work for usernames.

Anyone know a way around this?

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [September 30, 2020, 11:33pm UTC](https://community.gravityforms.com/t/how-to-use-email-address-as-username/6313/2 "2020-09-30T23:33:51Z")

</div>

Hi Dere. You can use the `gform_username` filter to assign a random username:

> **[gform\_username - Gravity Forms Documentation](https://docs.gravityforms.com/gform_username/)**
>
> This filter is used to dynamically alter or generate a username during the registration process.

The individual will be able to log in with their email address, and never need to know the username. (That is how we handle Gravity Forms registrations for this site: [https://www.gravityforms.com/register/](https://www.gravityforms.com/register/) - I just registered an account with my name and email address, and I was assigned this username: **user5f75159820ff0695856545** ).

---

<div class="post-metadata">

**Author:** ![user5c0166073a6c48.6](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/user5c0166073a6c48.6/32/17391_2.png) [@user5c0166073a6c48.6](https://community.gravityforms.com/u/user5c0166073a6c48.6)\
**Post date:** [September 30, 2020, 11:37pm UTC](https://community.gravityforms.com/t/how-to-use-email-address-as-username/6313/3 "2020-09-30T23:37:25Z")

</div>

This won’t auto-send the new user an email with their username? That would be awesome if it didn’t!

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [September 30, 2020, 11:40pm UTC](https://community.gravityforms.com/t/how-to-use-email-address-as-username/6313/4 "2020-09-30T23:40:29Z")

</div>

It’s worth a try (I used a fake email address, so I did not receive a notification.) If necessary, and the username is included, you could use a filter to modify the notification so that it does not send the username.

---

<div class="post-metadata">

**Author:** ![user5c0166073a6c48.6](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/user5c0166073a6c48.6/32/17391_2.png) [@user5c0166073a6c48.6](https://community.gravityforms.com/u/user5c0166073a6c48.6)\
**Post date:** [September 30, 2020, 11:41pm UTC](https://community.gravityforms.com/t/how-to-use-email-address-as-username/6313/5 "2020-09-30T23:41:47Z")

</div>

I’m going to try this right now.

---

<div class="post-metadata">

**Author:** ![user5c0166073a6c48.6](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/user5c0166073a6c48.6/32/17391_2.png) [@user5c0166073a6c48.6](https://community.gravityforms.com/u/user5c0166073a6c48.6)\
**Post date:** [September 30, 2020, 11:53pm UTC](https://community.gravityforms.com/t/how-to-use-email-address-as-username/6313/6 "2020-09-30T23:53:20Z")

</div>

I use a single line text field and map that field to the username field via the user registration tab. I added the function to functions.php but every time I attempt to create an account it says enter a username.

Does the name field actually have to be a native name field?

I also tried this by mapping the email field as the username in user registration. I get the same response, please add a username.

---

<div class="post-metadata">

**Author:** ![user5c0166073a6c48.6](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/user5c0166073a6c48.6/32/17391_2.png) [@user5c0166073a6c48.6](https://community.gravityforms.com/u/user5c0166073a6c48.6)\
**Post date:** [October 1, 2020, 1:36am UTC](https://community.gravityforms.com/t/how-to-use-email-address-as-username/6313/7 "2020-10-01T01:36:05Z")

</div>

@chrishajer you know a way around having to use the name field? Lol. Kind of at a loss here. I add the snippet but something isn’t quite adding up. This would be a really nice solution if I can get it to work. It’s strange though the last time I tested the sign up form I can’t recall having this issue.

---

<div class="post-metadata">

**Author:** ![richardw8k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/richardw8k/32/2354_2.png) [@richardw8k](https://community.gravityforms.com/u/richardw8k)\
**Post date:** [January 4, 2022, 5:53pm UTC](https://community.gravityforms.com/t/how-to-use-email-address-as-username/6313/8 "2022-01-04T17:53:29Z")

</div>


