Update User Role
Change user roles for access control and membership management.
Overview
The Update User Role action changes a user’s role in WordPress. This is essential for membership sites, access control, and automated permission management.
Configuration
Required Fields
| Field | Type | Description |
|---|---|---|
| User | select/integer | User to update |
| Role | select | New role to assign |
Optional Fields
| Field | Type | Default | Description |
|---|---|---|---|
| Add Role | boolean | false | Add to existing roles |
| Remove Role | string | - | Role to remove |
Roles
Standard WordPress roles:
| Role | Capabilities |
|---|---|
administrator | Full site access |
editor | Manage all content |
author | Publish own content |
contributor | Write drafts only |
subscriber | Read only |
WooCommerce roles:
| Role | Description |
|---|---|
customer | Can purchase and manage orders |
shop_manager | Can manage shop |
Custom roles from membership plugins work too.
Example Configurations
Upgrade Membership
User: {{Trigger.user_id}}
Role: premium_member
Downgrade on Expiry
User: {{Trigger.user_id}}
Role: subscriber
Add Role (Keep Existing)
User: {{Trigger.user_id}}
Role: content_creator
Add Role: true
Conditional Upgrade
Based on purchase:
User: {{Trigger.customer_id}}
Role: customer_vip
Condition: Order total > 500
Output Data
| Variable | Type | Description |
|---|---|---|
{{Action.user_id}} | integer | User ID |
{{Action.old_role}} | string | Previous role |
{{Action.new_role}} | string | New role |
Multiple Roles
WordPress supports multiple roles per user:
Add Additional Role
User: {{Trigger.user_id}}
Role: contributor
Add Role: true
# User keeps existing role AND gets contributor
Replace All Roles
User: {{Trigger.user_id}}
Role: editor
Add Role: false
# User's only role is now editor
Common Workflows
Purchase-Based Upgrade
- Trigger: Order Completed
- Condition: Product is membership
- Action: Update User Role
- User:
{{Trigger.customer_id}} - Role:
premium_member
- User:
Subscription Expiry
- Trigger: Subscription Expired
- Action: Update User Role
- User:
{{Trigger.user_id}} - Role:
subscriber
- User:
Manual Approval
- Trigger: Application Approved (custom)
- Action: Update User Role
- User:
{{Trigger.applicant_id}} - Role:
approved_member
- User:
Best Practices
- Log all role changes for auditing
- Use conditions to prevent unintended changes
- Test role transitions thoroughly
- Consider notification emails for role changes
Security Notes
- Never auto-assign administrator role
- Review custom role capabilities
- Monitor role change activity
- Implement approval workflows for sensitive roles