Answers.Body: <blockquote>
    <p>How do I control the user role that the CiviCRM users are synced as WordPress users? I'm using the "Role" Synchronization Method. Is this controlled by Association Rules?</p>
  </blockquote>
  
  <p>Yes, exactly. Association Rules are the "glue" between CiviCRM Memberships and WordPress Roles (or Capabilities).</p>
  
  <blockquote>
    <p>I need to add a rule for each CiviCRM membership level?</p>
  </blockquote>
  
  <p>Yes. FYI, if you have a large number of Membership Types, have a look at the newest feature in CiviCRM WordPress Member Sync, which allows you to do <a href="https://github.com/christianwach/civicrm-wp-member-sync#new-in-version-042" rel="nofollow noreferrer">"bulk creation" of Association Rules</a>.</p>
  
  <blockquote>
    <p>Will the "New User Default Role" in WordPress>General Settings override synced users Association Rules?</p>
  </blockquote>
  
  <p>No. It comes into play when syncing to Capabilities, since WordPress users must have a role of some kind. When syncing to Roles, the selected role is granted instead.</p>
  
  <blockquote>
    <p>Do I need to use <a href="https://wordpress.org/plugins/groups/" rel="nofollow noreferrer">https://wordpress.org/plugins/groups/</a> ?</p>
  </blockquote>
  
  <p>No, but CiviCRM WordPress Member Sync has deeper integration with the Groups plugin than with the Members plugin.</p>
  
  <p>The integration with Members consists solely of granting WordPress users the <code>restrict_content</code> capability, which is what Members uses to determine access to, well, restricted content. The capability is removed when the Membership expires.</p>
  
  <p>The integration with Groups is more sophisticated, in that Group membership can be independent of the user's role or capability. Capabilities can be assigned to groups in much the same way that roles are collections of capabilities. Membership Types can be added to (or removed from) groups depending on the status of the membership.</p>
  
  <p>So... if you have removed the WordPress admin users and want to recreate them with a different role, make sure you have edited your Association Rules so that the Contacts with the appropriate Membership Type sync to your desired current and expiry roles.</p>
  
  <p>FWIW, by default CiviCRM WordPress Member Sync will not sync users with the admin role in WordPress. This can be modified with <a href="https://github.com/christianwach/civicrm-wp-member-sync/blob/master/includes/civi-wp-ms-members.php#L375-L384" rel="nofollow noreferrer">a filter</a>, but since you're avoiding granting WordPress users admin rights, you shouldn't be caught by this.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-04T18:07:11.313Z
Answers.Text: Thanks! This is really helpful. One extra question: In Add Association Rules, after I select a CiviMember Membership Type, the Current Status is a little confusing; I'm thinking I tick both New and Current if I want to gate content for all members in that membership type? What are the differences between New and Current?
Answers.UserDisplayName: BlueDogRanch
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-05T08:57:41.257Z
Answers.Text: It's best to declare New, Current and Grace as "current" memberships. (FWIW, there's discussion about referring to these as "active" memberships in future.) New memberships become Current memberships after a period chosen in the "Membership Status Rules" that you define - if you loaded the demo data, this happens after 3 months.
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-03T10:40:04.073Z
Answers.LastActivityDate: 2019-12-03T10:40:04.073Z
Answers.UserDisplayName: Christian Wach
Answers.Body: <p>When you use the synchronise the outcome should be that someone would only become an Authenticated user ie the default user role so perhaps check under "New User Default Role" and ensure it is not set as Administrator in WordPress>General Settings. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-02T20:05:37.787Z
Answers.Text: That's mostly true; but what happens if I have different roles set up in Members and different Association Rules for those roles?
Answers.UserDisplayName: BlueDogRanch
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-02T22:46:43.347Z
Answers.Text: I think WP also offers a synch for the Roles to be based off either civi Groups or civi memberships. not sure if either of those help you. certainly available in drupal.
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-02T19:02:28.117Z
Answers.LastActivityDate: 2019-12-02T19:02:28.117Z
Answers.UserDisplayName: petednz - fuzion
Body: <p>I'm working on an inherited CiviCRM/WordPress site using the CiviCRM WordPress Member Sync <a href="https://wordpress.org/plugins/civicrm-wp-member-sync/" rel="nofollow noreferrer">https://wordpress.org/plugins/civicrm-wp-member-sync/</a> and the Members plugin <a href="https://wordpress.org/plugins/members/" rel="nofollow noreferrer">https://wordpress.org/plugins/members/</a> and I can't find an answer to the question below in any docs.</p>
  
  <p>In the past, someone used the Manual Synchronize feature of Member Sync to manually sync all CiviCRM members to WordPress, but all users were Administrators. After a reinstall of CiviCRM, an import of a CiviCRM database, and deleting all the old WordPress Administrators, I now need to manually sync the users again. But of course I don't want them synced as administrators; I need them synced as lower level roles in order to restrict access to page content and of course not give admin privledges.</p>
  
  <p>How do I control the user role that the CiviCRM users are synced as WordPress users? I'm using the "Role" Synchronization Method.</p>
  
  <p>Is this controlled by Association Rules? I need to add a rule for each CiviCRM membership level?</p>
  
  <p>Will the "New User Default Role" in WordPress>General Settings override synced users Association Rules?</p>
  
  <p>Do I need to use <a href="https://wordpress.org/plugins/groups/" rel="nofollow noreferrer">https://wordpress.org/plugins/groups/</a> ?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-02T18:30:42.670Z
Comments.Text: I don't know WP as well as Drupal, but if you did this in Drupal the outcome would be that someone would only become an Authenticated user. I assume WP has a similar concept, ie they get the default user role
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-02T18:34:47.470Z
Comments.Text: Ah, that might be it; I now see "New User Default Role" set as Administrator in WordPress>General Settings. I didn't remember that setting; and now realize that maybe it has an overall effect on all imported users.
Comments.UserDisplayName: BlueDogRanch
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-02T19:03:26.393Z
Comments.Text: glad it helped. i have converted above discussion to an Answer to help others (which is what Stack Exchanges wants). Could you pls Accept and +1 it.
Comments.UserDisplayName: petednz - fuzion
Tags: <wordpress>
Title: How do I control the imported user role when using CiviCRM WordPress Member Sync?
ThreadText: # How do I control the imported user role when using CiviCRM WordPress Member Sync?
  
  (Asked by: username_0 on 2019-12-02)
  
  I'm working on an inherited CiviCRM/WordPress site using the CiviCRM WordPress Member Sync <https://wordpress.org/plugins/civicrm-wp-member-sync/> and the Members plugin <https://wordpress.org/plugins/members/> and I can't find an answer to the question below in any docs.
  
  In the past, someone used the Manual Synchronize feature of Member Sync to manually sync all CiviCRM members to WordPress, but all users were Administrators. After a reinstall of CiviCRM, an import of a CiviCRM database, and deleting all the old WordPress Administrators, I now need to manually sync the users again. But of course I don't want them synced as administrators; I need them synced as lower level roles in order to restrict access to page content and of course not give admin privledges.
  
  How do I control the user role that the CiviCRM users are synced as WordPress users? I'm using the "Role" Synchronization Method.
  
  Is this controlled by Association Rules? I need to add a rule for each CiviCRM membership level?
  
  Will the "New User Default Role" in WordPress>General Settings override synced users Association Rules?
  
  Do I need to use <https://wordpress.org/plugins/groups/> ?
  
  **Tags:** wordpress
  
  > **Comments:**
  > **username_1**: I don't know WP as well as Drupal, but if you did this in Drupal the outcome would be that someone would only become an Authenticated user. I assume WP has a similar concept, ie they get the default user role  
  > **username_0**: Ah, that might be it; I now see "New User Default Role" set as Administrator in WordPress>General Settings. I didn't remember that setting; and now realize that maybe it has an overall effect on all imported users.  
  > **username_1**: glad it helped. i have converted above discussion to an Answer to help others (which is what Stack Exchanges wants). Could you pls Accept and +1 it.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2019-12-03. Score: 2 | Accepted answer
  
  > How do I control the user role that the CiviCRM users are synced as WordPress users? I'm using the "Role" Synchronization Method. Is this controlled by Association Rules?
  
  Yes, exactly. Association Rules are the "glue" between CiviCRM Memberships and WordPress Roles (or Capabilities).
  
  > I need to add a rule for each CiviCRM membership level?
  
  Yes. FYI, if you have a large number of Membership Types, have a look at the newest feature in CiviCRM WordPress Member Sync, which allows you to do ["bulk creation" of Association Rules](https://github.com/username_2/civicrm-wp-member-sync#new-in-version-042).
  
  > Will the "New User Default Role" in WordPress>General Settings override synced users Association Rules?
  
  No. It comes into play when syncing to Capabilities, since WordPress users must have a role of some kind. When syncing to Roles, the selected role is granted instead.
  
  > Do I need to use <https://wordpress.org/plugins/groups/> ?
  
  No, but CiviCRM WordPress Member Sync has deeper integration with the Groups plugin than with the Members plugin.
  
  The integration with Members consists solely of granting WordPress users the `restrict_content` capability, which is what Members uses to determine access to, well, restricted content. The capability is removed when the Membership expires.
  
  The integration with Groups is more sophisticated, in that Group membership can be independent of the user's role or capability. Capabilities can be assigned to groups in much the same way that roles are collections of capabilities. Membership Types can be added to (or removed from) groups depending on the status of the membership.
  
  So... if you have removed the WordPress admin users and want to recreate them with a different role, make sure you have edited your Association Rules so that the Contacts with the appropriate Membership Type sync to your desired current and expiry roles.
  
  FWIW, by default CiviCRM WordPress Member Sync will not sync users with the admin role in WordPress. This can be modified with [a filter](https://github.com/username_2/civicrm-wp-member-sync/blob/master/includes/civi-wp-ms-members.php#L375-L384), but since you're avoiding granting WordPress users admin rights, you shouldn't be caught by this.
  
  > **Comments:**
  > **username_0**: Thanks! This is really helpful. One extra question: In Add Association Rules, after I select a CiviMember Membership Type, the Current Status is a little confusing; I'm thinking I tick both New and Current if I want to gate content for all members in that membership type? What are the differences between New and Current?  
  > **username_2**: It's best to declare New, Current and Grace as "current" memberships. (FWIW, there's discussion about referring to these as "active" memberships in future.) New memberships become Current memberships after a period chosen in the "Membership Status Rules" that you define - if you loaded the demo data, this happens after 3 months.  
  
  ---
  
  ### Answer by username_1 on 2019-12-02. Score: 1
  
  When you use the synchronise the outcome should be that someone would only become an Authenticated user ie the default user role so perhaps check under "New User Default Role" and ensure it is not set as Administrator in WordPress>General Settings.
  
  > **Comments:**
  > **username_0**: That's mostly true; but what happens if I have different roles set up in Members and different Association Rules for those roles?  
  > **username_1**: I think WP also offers a synch for the Roles to be based off either civi Groups or civi memberships. not sure if either of those help you. certainly available in drupal.  
  
  ---
  
  