WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 it possible to do something to WP so that I'm able to use the e-mail address as username?

I do not want to download a plugin for this.

share|improve this question
I'm not sure if the WP's user registration page allows it, but the wp_insert_user_() function certainly does... I did this for a newsletter registration system, where each subscriber has the email assigned as name – onetrickpony Nov 10 '11 at 14:04

You can easily do this, all you have to do is create a user registration page and have the email address field fill both the username and email args to use for the wp_insert_user() function.

share|improve this answer
Any chance of WP misbehaving when doing this? – Steven Nov 10 '11 at 17:17

WordPress uses the following function when creating users:


Sanitize username stripping out unsafe characters.

If $strict is true, only alphanumeric characters plus these: _, space, ., -, *, and @ are returned.

Removes tags, octets, entities, and if strict is enabled, will remove all non-ASCII characters. After sanitizing, it passes the username, raw username (the username in the parameter), and the strict parameter as parameters for the filter.

Short answer: Not without a plugin.

Source: http://codex.wordpress.org/Function_Reference/sanitize_user

share|improve this answer
can't I create my own username sanitazion in functions.php that overrides the one WP is using by deafult? – Steven Nov 11 '11 at 8:24
You're going to do it within a theme or edit the default functions.php? – Sterling Hamilton Nov 11 '11 at 18:39

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.