Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a specific or preferred way to set the username for new user registrations to be their email address?

At the moment my user signup form contains both fields:

<!-- Username -->
  <label for="username">Username</label>
    <input type="text" id="username" name="username" placeholder="joesmith" {%- if account is defined %} value="{{ account.username }}"{% endif -%}/>
    {% if account is defined %}
        {{ _self.errorList(account.getErrors('username')) }}
    {% endif %}

<!-- Email -->
  <label for="email" >Email</label>
    <input type="text" id="email" name="email" {%- if account is defined %} value="{{ }}"{% endif -%}/ autocapitalize=off autocorrect=off>
    {% if account is defined %}
        {{ _self.errorList(account.getErrors('email')) }}
    {% endif %}
share|improve this question
up vote 9 down vote accepted

I believe you're looking for the conveniently named useEmailAsUsername config setting.

When that is set to true, any new user that is saved with a valid email address will have that copied over to the username field as well.

share|improve this answer
Thanks! I knew I had seen something like that before. – Niall Thompson Jul 23 '14 at 18:37
Now all you need to do is mark it as the answer. :P – Brad Bell Jul 23 '14 at 18:45
This made me weep with joy. So convenient and smoothly implemented. – Bitmanic Oct 7 '14 at 16:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.