Hi there,
You may use the following filter to create WooCommerce users with a “Subscriber” role.
This code can be added yo your website using a plugin such as Code snippets.
add_filter( 'woocommerce_new_customer_data', 'woocommerce_new_customer_data_set_role' );
/**
* Function for woocommerce_new_customer_data filter hook.
*
* @param array $customer_data An array of customer data.
*
* @return array
*/
function woocommerce_new_customer_data_set_role( $customer_data ){
$customer_data['role'] = 'subscriber';
return $customer_data;
}
Note: Roles are used to determine what type of access a user should have across the website. Changing a user role may impact their experience with WooCommerce and/or third-party plugins. Test this on a staging site before applying the code to a production environment.