How can i force Display names to be the same as Usernames?

You can use the wp_pre_insert_user_data filter. function wpse_filter_user_data( $data, $update, $id) { if( isset( $data[ ‘user_login’ ] ) ) { $data[ ‘display_name’ ] = $data[ ‘user_login’ ]; return $data; } $user = get_user_by( ’email’, $data[ ‘user_email’ ] ); $data[ ‘display_name’ ] = $user->user_login; return $data; } add_filter( ‘wp_pre_insert_user_data’, ‘wpse_filter_user_data’, 10, 3 ); You’ll probably want … Read more

Filter username field on registration for profanity and unwanted words

There are two very different hooks you can use, depending on the installation: wpmu_validate_user_signup for multi-site and registration_errors for single-site. The following untested code shows how to use them. You can tweak the array in user_name_is_forbidden() to your needs. Use regular expressions for the matches. // multi-site add_filter( ‘wpmu_validate_user_signup’, function( $result ) { // there … Read more

Changing the username character limit from four to less characters

You can filter ‘wpmu_validate_user_signup’ and check if the error code matches the 4 character warning. Then just unset the error code. Sample plugin: <?php # -*- coding: utf-8 -*- /* Plugin Name: Allow short user names for multi site. */ add_filter( ‘wpmu_validate_user_signup’, ‘wpse_59760_short_user_names’ ); /** * Allow very short user names. * * @wp-hook wpmu_validate_user_signup … Read more