WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 3 months ago

#14644 reopened feature request

Administrator should be able to change usernames

Reported by: holizz Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Users Keywords: 2nd-opinion
Focuses: Cc:

Description

I can't think of any reason why administrators shouldn't be able to change usernames.

I do this occasionally (via SQL) and find that it causes no problems whatsoever (that I've noticed).

Change History (21)

comment:1 ramiy4 years ago

  • Component changed from General to Users

I think you can do this by using plugins.

comment:2 Denis-de-Bernardy4 years ago

One problem you could get, if you do this using the db while using memcached, is the the old value remains in the store until memory runs out.

comment:3 nacin4 years ago

  • Keywords close added

As Denis highlighted, this is a caching issue. Additionally, it also breaks URLs and such, which is why I don't think administrators should be able to do it either.

Seems simple enough to relegate to a plugin, or a straight DB edit.

Suggesting wontfix.

comment:4 johanee4 years ago

I think this functionality would be useful. But not so useful I'll implement it myself right now.

Depending on what you want to accomplish it is also a bit trickier than simply changing a value in DB -- if you want to do it right.

How to handle the interaction username, nicename, displayname should really be considered if any change were to be made in core WordPress.

One problem you could get, if you do this using the db while using memcached, is the the old value remains in the store until memory runs out.

Surely memcached allows invalidation. And we already have clean_user_cache($id).

... it also breaks URLs and such, which is why I don't think administrators should be able to do it either.

Administrators have plenty ways already to break URLs. :)

Furthermore URLs use user "nicename" values which are separate from (but constructed based on) username. From a security viewpoint it would actually be interesting to be able to set these separately.

Changing a username will of course make the users current auth cookie invalid.

comment:5 jane4 years ago

  • Type changed from defect (bug) to feature request

This is a feature request, not a bug report, since it currently functions as intended.

I'm with @nacin that it's still plugin territory for now. It's a handy feature, but not one that everyone needs all the time, and those that do are probably clever enough to install a plugin.

comment:6 nacin3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

comment:7 ryansatterfield15 months ago

  • Keywords 2nd-opinion added
  • Resolution wontfix deleted
  • Status changed from closed to reopened

I believe this needs to be reopened. You should be able to change the username in the settings. In my opinion the username and nice name should be separate. I do not believe this should be in plugin territory, unless it is made by wordpressdotorg or wordpressdotcom. Plugins are exploited left and right, so it doesn't seem logical to keep this in the plugin territory, since it is editing a core part of WordPress.

So many people have the username admin and don't know how to change it.

comment:8 SergeyBiryukov15 months ago

  • Milestone set to Awaiting Review

comment:9 knutsp15 months ago

  • Cc knut@… added

comment:10 alexvorn215 months ago

  • Cc alexvornoffice@… added

comment:11 adamsilverstein15 months ago

  • Cc ADAMSILVERSTEIN@… added

comment:12 ryan15 months ago

Changing user names break permalinks. If we did this we'd need to add old slug redirects for users.

comment:13 knutsp15 months ago

Changing categories and tags may also break permalinks, as long as the slug is also changed. An administrator can do a lot to harm permalinks if he doesn't know how they are built and the importance of keeping them permanent. For users the user_nicename is the slug. Just keep the slug and perhaps display it in user-edit.php.

comment:14 follow-up: douglsmith15 months ago

wordpress.com even allows users to change their username (with the caveat that you can never go back to the old one.) Anyone know how that is handled?

comment:15 in reply to: ↑ 14 ; follow-up: alexvorn215 months ago

Replying to douglsmith:

wordpress.com even allows users to change their username (with the caveat that you can never go back to the old one.) Anyone know how that is handled?

on wordpress.com users are not admins.

comment:16 in reply to: ↑ 15 kovshenin15 months ago

Replying to alexvorn2:

on wordpress.com users are not admins.

They are admins, but not super admins.

comment:17 SergeyBiryukov12 months ago

Replying to ryansatterfield:

In my opinion the username and nice name should be separate.

Related: #24078

Last edited 10 months ago by SergeyBiryukov (previous) (diff)

comment:18 ryansatterfield12 months ago

  • Keywords close removed

Yes, they are related, but this was opened 3 years ago. Related #24078 was opened 7 hours ago.

comment:19 follow-up: alexvorn212 months ago

The solution is simple: create a new user, make him admin too, and delete the "admin" user.

Last edited 12 months ago by alexvorn2 (previous) (diff)

comment:20 in reply to: ↑ 19 ; follow-up: azaozz12 months ago

Replying to alexvorn2:

Which will break permalinks even more than changing the username along with a lot of other stuff, like some post meta, where the user ID is stored.

comment:21 in reply to: ↑ 20 drewnorthup3 months ago

Replying to azaozz:

Replying to alexvorn2:

Which will break permalinks even more than changing the username along with a lot of other stuff, like some post meta, where the user ID is stored.

Granted that, is there a chance for getting a simple monotonically increasing index key made the PK/FK data instead of the username? Perhaps sometime in 4.x?

Note: See TracTickets for help on using tickets.