WordPress does not let you edit the login name (user_login) of an account. This plugin adds one admin page that changes it for any user, together with the public name fields. You pick the user by login name, email address or user ID (a login that is only digits is tried as a login before it is read as an ID); leaving the box empty selects your own account. The user ID is not touched, so posts, roles, email address, password and other user meta stay attached to the account.
The page edits these fields of the selected user:
user_login)user_email)user_nicename)display_name)The login name is written first with a single $wpdb->update() on the row of the selected user’s ID, because core has no function for it, and the user cache is cleared around it. The super admin list follows, then the profile fields are saved with wp_update_user(). If a later step fails, the earlier ones are put back, so a failed save leaves the account as it was. If you rename the account you are signed in with, a new authentication cookie is issued for the same user ID so your current session is not ended. Other users’ sessions end, because authentication cookies contain the login name.
On Multisite, a username is stored once for the whole network, so a rename applies to every site and the page is available only to super admins. On a single site it is available to users with the manage_options capability. If the old login name is listed in the network’s super admin list (site_admins), the list is updated to the new name. If that update fails, the old login name is written back and nothing is changed.
validate_username(), must not already belong to another account and must not appear in the illegal_user_logins filter or, on Multisite, in the network’s “Banned Names” list. On Multisite the rules WordPress applies to new network users also apply to a changed login: at least 4 characters, lowercase letters and numbers only, not only numbers, and not reserved by a pending sign-up from the last two days. A login you leave unchanged is not checked against these rules.sanitize_title(). Must not be used by another account. This is the part of the author archive URL (/author/slug/); links to the old slug stop working unless you add a redirect.wp_check_password() before anything is changed. It is not stored and not changed. After 5 wrong passwords the page refuses further attempts from that account for 15 minutes.elmcu_login_changed action (arguments: user ID, old login, new login).This plugin does not connect to any external service. The “Support the development” notice on the plugin page contains a link to https://id7.dev/donate/ that opens only when you click it.