0

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?

1 Answer 1

3

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

2
  • 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
    Commented Mar 23, 2011 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
    Commented Mar 24, 2011 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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