Support » Plugin: CiviCRM WordPress Member Sync » Delete users with no role

  • peterupaulo

    (@peterupaulo)


    Is there a way expired members in civicrm will be deleted in wp member account?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Christian Wach

    (@needle)

    Are you syncing memberships to roles or capabilities? Either way, it’s tricky, but the approach depends on this.

    Cheers, Christian

    Are you syncing memberships to roles or capabilities?
    – Yes, we plan if it’s possible if those with no roles will be automatically be deleted as wp users.
    – is there a way to do this? or options in the plugin

    Plugin Author Christian Wach

    (@needle)

    @peterupaulo I have to ask again: are you syncing memberships to roles or capabilities? There is a setting in the plugin which switches between the two modes of operation. “Yes” doesn’t tell me which mode you are in 🙂

    Either way, there are no options in the plugin for this. It will require custom code to achieve.

    @christian We are using Roles Method. Thanks for your reply. Will you add this feature in the future updates?

    Plugin Author Christian Wach

    (@needle)

    @peterupaulo Thanks for clarifying.

    I don’t think I should add this as an option to the plugin for a couple of reasons:

    • Of the 400+ installs, you are the first to request this configuration.
    • Expired memberships can usually be renewed, so deleting a member’s WordPress user would mean rebuilding it. This doesn’t make sense to me for most cases.

    What I suggest is that you look at the civi_wp_member_sync_rule_apply_roles_expired action which allows you to know when a WordPress user has the expired role applied to it. The parameters should give you enough context to make sure you’re dealing with the correct event to delete the user in question.

    You will also have to prevent a new WordPress user from being created if you keep the CiviCRM membership record because any change to that record will cause one to be created. This can be overridden with the civi_wp_member_sync_auto_create_wp_user filter.

    Cheers, Christian

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.