Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

We are using email addresses as usernames in a current WP 3.1 project. I need to allow users to change their usernames and email addresses, and will build in the option to do so.

I am just wondering why this is not allowed by default in WP?

What can go wrong if I let our users change their passwords?

share|improve this question

1 Answer 1

The problem with changing usernames is that it's a caching issue and that it breaks /author/username URLs.

The URL breaking issue is obvious.

The caching issue is less obvious. If you're using a persistent object cache like memcached or something, then the username will be stored in that cache, and thus it won't change properly until the cache runs out.

On a simple site setup, this doesn't happen because it doesn't have persistent object caching. On a complex one, it becomes a real problem. A fair number of changes to the user system would be needed to allow the caching to be taken care of properly.

A core feature request was rejected for this because of the limited need for it, basically. However, a core patch to correct the caching issue might be better considered, allowing for a much simpler plugin to change the username (or a simple patch to allow same, once the caching issue is cleared up).

Reference: http://core.trac.wordpress.org/ticket/14644

share|improve this answer
    
Isn't there a difference between the user_login and the user_nicename, which is used to create the URLs? If you change the login without changing the nicename, the URL would not change. –  Jan Fabry Mar 23 '11 at 21:26
    
True, however the nicename is generated from the login by default (it's the sanitized version of the user_login). If you change the login but not the nicename, then it will certainly look weird throughout the system. –  Otto Mar 24 '11 at 11:28

Your Answer

 
discard

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.