• My client wants users to login with there email address, so don’t want users to have to chose a username when they register. Is this possible?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    The plugin does allow login with the user’s username OR email by default.

    However, I don’t generally recommend removing the username field from registration. This is a field that MUST be populated (whether by the user or by you) in order for WP to create a user (it’s a mandatory field for WP).

    You could potentially filter the field out of the display with wpmem_register_form_rows, but because the validation is built around having a populated value, you’d have to create a username (I’d recommend parsing the user’s email address and creating it from that). You can use wpmem_pre_validate_form for that (see: https://rocketgeek.com/plugins/wp-members/docs/filter-hooks/wpmem_pre_validate_form/). that would allow you to create a username and insert it with the form values before the values are validated for submission (Note the field is in the array as “username” and not “user_login”).

    Thread Starter steveindzine

    (@steveindzine)

    Hi @cbutlerjr, thank you, I will take a look and see what I can do. I am happy to use the email address as the username.

    This functionality, ‘use email address as username’, should be easy to enable in the settings. The golden rule is, the less fields you have, the higher the opt-in rate.
    The username field is one too many. It’s totally not needed.
    People nowadays are used to login with their unique e-mail address and a password.

    Is it possible to add this functionality? (Disable the username field, so that it automatically uses the email address as user)

    Or do you have a complete working snippet, we can add to functions.php?

    Regards,
    Marky

    • This reply was modified 3 years, 3 months ago by marky554.

    Chad’s point is crucial. Username is a mandatory WordPress field. You could change the username login prompt to say “User Name or Email” to make it clear to your users.

    I’ve found a couple of problems with forcing the username to be the email address:

    1. Remarkably, not all senior users have email addresses.
    2. Some users live together and don’t want two identical emails from every mailing.

    I ask new users to enter a username that is either a genuine email address or a fake one in the form [email protected]. Seems to work.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hide username on registration form’ is closed to new replies.