1. Home
  2. Knowledge Base
  3. WooCommerce Members Only
  4. Roles
  5. Remove existing user roles
  1. Home
  2. Knowledge Base
  3. WooCommerce Members Only
  4. Remove existing user roles

Remove existing user roles

You can use the following filter to remove existing user roles if a user is assigned a new role when purchasing a product:

<?php
/**
* Remove existing user roles if a user is assigned a new role when purchasing a product
*/
add_filter( 'wcmo_remove_existing_roles', '__return_true' );

This is how to add a snippet.

Was this article helpful?

Related Articles