How To Disable CheckoutWC Templates for WordPress User Role

To disable CheckoutWC templates for a particular user role, you can use this snippet of code:

To find the right role name, go to WP Admin > Users and click on the role you want to exclude. 

Then check the page URL for the role name. Example URL:


For this example, you would change the value of $role_to_disable to ‘wholesale’;