# Memberpress: how to add users to groups upon Sign up

**URL:** <https://meta.discourse.org/t/memberpress-how-to-add-users-to-groups-upon-sign-up/83478>\
**Category:** WordPress\
**Created:** [21.Март.2018 13:48:54 UTC](https://meta.discourse.org/t/memberpress-how-to-add-users-to-groups-upon-sign-up/83478 "2018-03-21T13:48:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [21.Март.2018 16:00:34 UTC](https://meta.discourse.org/t/memberpress-how-to-add-users-to-groups-upon-sign-up/83478/2 "2018-03-21T16:00:34Z")

</div>

> [@Dani1](#):
>
> I use Memberpress on my WP site.

> [@Dani1](#):
>
> How can I connect the membership levels to the Discourse Groups so that this happens automatically upon Signup?

The easiest approach is to use the Discourse WordPress plugin: [WP Discourse – WordPress plugin | WordPress.org](https://wordpress.org/plugins/wp-discourse/) and enable Single Sign On between WordPress and your forum. This will make your WordPress site responsible for all user authentication on Discourse.

To automatically add users to groups will require a bit of custom code. The [WP Discourse](https://github.com/discourse/wp-discourse) plugin has a couple of functions that can be used when SSO is enabled for automatically adding and removing users from Discourse groups. The functions are `add_user_to_discourse_group` and `remove_user_from_discourse_group`. You can find them here: [https://github.com/discourse/wp-discourse/blob/master/lib/utilities.php#L309](https://github.com/discourse/wp-discourse/blob/master/lib/utilities.php#L309).

There is some information about using these functions in this topic: [Manage group membership in Discourse with WP Discourse SSO](https://meta.discourse.org/t/managing-discourse-group-membership-with-wp-discourse/74724).

---

_[View the full topic](https://meta.discourse.org/t/memberpress-how-to-add-users-to-groups-upon-sign-up/83478)._
