Articles of username

How to check username availability with ajax at registration

I’m using buddypress which uses its own template form register.php for registration at I’m looking for a way to show the user whether or not their entered username is available using ajax validation. Here is a snippet from the form. <?php do_action( ‘template_notices’ ) ?> <?php do_action( ‘bp_before_account_details_fields’ ) ?> <div class=”register-section” id=”basic-details-section”> <?php […]

How do I display logged-in username IF logged-in?

I’m working on creating some text that says ‘Login’ to users that are not logged in, and the user’s username or display name when logged in. It seems like it should be an easy problem to solve, and I’ve found the following two bits of code on the wordpress codex that each do half of […]

Change Username?

A while back I was able to change the user-name in the wp_users table without problem. I noticed today that is not the case, or at least not with the super-admin user role. How can I adjust the user-name for a super-admin? I’m simply changing a user name first character from uppercase to lowercase. It’s […]

Change default ordering of display name

WordPress dashboard offers user the opportunity to choose whether their name is output as Firstname Lastname or several other options with Firstname Lastname order the default. I would like that default changed to Lastname Firstname. Can anyone suggest how it can be done?

Showing the user's username in registration email or activation page with BuddyPress

a) I would like the person’s username to be included in their activation email once they have registered. e.g. Activation email would look like: Thanks for registering! To complete the activation of your account please click the following link and log in using USERNAME and password you chose: activation link url Or if that is […]

How to set a minimum length for username in Woocommerce?

I need to set a minimum lenght for username in a website that use WooCommerce. In a “standard” WordPress installation (without WooCommerce, I mean) I could use a snippet like this one: function my_registration_errors( $errors, $sanitized_user_login, $user_email ) { if ( strlen( $sanitized_user_login ) < 5 ) { $errors->add( ‘username_too_short’, __( ‘<strong>ERROR</strong>: Username must be […]

WordPress User Name Limitations

I need to know what the wp specifications for the usernames are. Like allowed minimum and maximum length, are special characters like ü,ö,ä,ß accepted,..? Unfortunately I couldn’t find any insight on this in the interweb. Do you have any?

Update user_login to change username

I’m trying to update user_login in the wp_users table, to force update a user’s username to their email address on submission of a front end edit profile form. I know WordPress forbids this via the wp_update_user function so I am trying to use SQL with wpdb functions. Here is what I have, and it is […]

Menu Link Redirect Based on Username or User ID

I am building a client portal where my clients can log in and see all their pending projects, completed projects and create new projects. Though I’m stuck at the start. The dropdown menu is called “My Projects” If “User 1” is logged in and they click on “My Projects” then I need that link to […]

How to prevent certain usernames from being registered?

How can i prevent or blacklist a list of usernames that i don’t want users to register with? And can I add a message if they try to register with one of those names that says ‘this username has been reserved’ Is this possible?