Automatically created username problem

I’ve just spotted that when WooCommerce registers users by autocreating the username (and thus the nickname), sometimes randomly it uses all of the user’s email address in the username and nickname by setting the nickname to eg. first-lasthotmail-com. Most of the time it does the job properly but it’s actually quite a serious problem when using BuddyBoss because it leaks personal data since the nickname is pretty visible in BuddyBoss.

Has anyone else seen this and do you have better ideas of what to do about it? As a temporary measure I’ve had to turn off “When creating an account, automatically generate an account username for the customer based on their name, surname or email” so customers have to choose their own username. This is a little bit of friction I’d rather not have.

1 thought on “Automatically created username problem

  1. Took a look at WooCommerce core, and the customer username creation function comes with a filter that should let you alter the username hopefully:

    apply_filters( 'woocommerce_new_customer_username', $username, $email, $new_user_args, $suffix );

Your email address will not be published. Required fields are marked *