How can I stop Subscriptions from changing a user’s role?

WooCommerce Subscriptions changes a user’s role by default, when the status of their subscription or subscriptions change, as explained in the Role Settings document.

However, it is possible to stop this default behaviour with a small amount of custom code. This setup is helpful when you implement a custom user role or logic on a site and need to keep other user roles assigned when someone subscribes. Below, you’ll find a simple plugin demonstrating how to achieve this.

Scope of support:

We are unable to provide support for customizations under our Support Policy. If you need to customize a snippet or extend its functionality, we recommend working with a Woo Agency Partner or a WooCommerce developer on Codeable.

<?php
/**
* Plugin Name: Stop WooCommerce Subscriptions Changing a User's Role
* Plugin URI:
* Description:
* Author: Brent Shepherd
* Author URI:
* Version: 1.0
*/
add_filter( 'woocommerce_subscriptions_update_users_role', '__return_false', 100 );

Related Products

Power your membership association, online magazine, elearning sites, and more with access control to content/products and member discounts.

Use conditional logic to restrict the shipping and payment options available on your store.