1. Home
  2. Knowledge Base
  3. WooCommerce Members Only
  4. Remove existing user roles
  1. Home
  2. Knowledge Base
  3. Roles
  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?

Need More Support?

If you can't find the answer that you're looking for, then please use the link below to raise a support ticket.
Contact Support

Related Articles