How to use User Roles
WordPress uses "user roles" to manage such things as users access, privacy, privileges, etc. Ultimate Member extends this functionality to limit profile access.
- Assign user role
- Configure role fields
- Configure profile access
- Add role-specific content
Assign user role #
Default role #
Each user has one or several roles. WordPress assigns a default user role when creating a new user. Use the setting "New User Default Role" on the page [wp-admin > Settings > General] to select the default user role. You may override this setting by registration form settings, it may be useful if you have several registration forms.
Change users role manually #
The Administrator can use the bulk action "Change role to..." on the page [wp-admin > Users > All Users] to change the user role manually.
Image 1 - How to set the user role manually.
Change user role on purchase #
Our extension "Ultimate Member - WooCommerce" can change or add a user role automatically when the user purchases a product or subscription.
Read the article WooCommerce Setup to get know how to configure this extension.
Configure role fields #
You can use field types "Roles (Dropdown)" and "Roles (Radio)" to set the user role in the registration form or change it in the profile form. But not all roles are available. Role fields may contain user roles created by Ultimate Member and predefined role Subscriber. User roles created by third-party plugins are excluded to avoid conflicts. Predefined roles with high access level (such as Administrator or Editor) are excluded to avoid security vulnerability.
You have to create a role using the button "Add New" on the page [wp-admin > Ultimate Member > User Roles], then add this role to the list of "Edit Choices" in the field settings.
Image 2 - Configure role field choices
Configure profile access #
User role settings #
You can list all existing user roles on the page [wp-admin > Ultimate Member > User Roles]. You can create a new user role by clicking the button "Add New". You can overview and change user role settings by clicking the user role name. Use settings "Can view other member profiles?" and "Can view these user roles only" to manage profiles visibility for the user role.
Read the article User Roles Settings for details.
Image 3 - Limit profile access by roles.
Role Priority #
WordPress users may have several roles. Ultimate Member uses settings from the role with a highest priority.
Read the article How to set Role Priority for user roles for details.
Image 4 - Role Priority.
Members Directory settings #
You can create several member directories with different settings. Each member directory has an unique shortcode that you can paste to the page to display it. You can get the shortcode, change settings or create a new member directory on the page [wp-admin > Ultimate Member > Member Directories]. Use the setting "User Roles to Display" to select what user roles this member directory should display.
Read the article Member Directories 2.1.0+ for details.
Image 5 - Limit members directory by roles.
Add role-specific content #
Ultimate Member allows you to show or hide content to specific user role. You can do this by wrapping the content with the following shortcodes:
Show content to specific roles
[um_show_content roles="member"] <!-- insert content here --> [/um_show_content]
Hide content from specific roles
[um_show_content not="member"] <!-- insert content here --> [/um_show_content]
You can add multiple target roles, just use ',' e.g. [um_show_content roles="member,candidates,pets"]
Read the article Restrict content on a page/post to specific users community role for details.