I need new users to automatically be added to a membership pro 2

I am using social login to allow my users to connect with Facebook
the new users are assigned to the subscriber Wordpress group
I need those to automatically be added to a membership pro 2 membership.

Support Access enabled.

  • Joel

    It's been 2 days without so much as a courtesy response. Many free plugins have much better support. Membership 2 Pro has no support for any social login plugin and the social login functionality for Membership 2 Pro was apparently discontinued. Why anyone would use a membership system that cannot work with social logins is beyond me.

    I need some help here or I will have no choice but to cancel my membership and go in another direction.

    Thank you.

  • Patrick

    Hi there Joel

    I hope you're well today!

    Sorry for the delay on this ticket. We must reply to each one in order of oldest to newest, and many tickets are now quite time-consuming as all the easy stuff is handled via our live chat support platform. :slight_smile:

    That said, Membership2 doesn't have any social login integration as you have seen. So the easiest way to ensure that your users can use their social logins, and still have your content protected, would be to have a social login page and after login, redirect your users to your memberships page so they can then choose their desired membership.

    You could also create a Guest membership which will be applied to all registered users without any other membership assigned. This way, you can limit your content between visitors and logged in users.

    Would that work for you?

  • Patrick

    Hi again Joel

    This is a continuation of our live chat. As we have discovered, using WordPress Social Login plugin, users do indeed have access to content allowed by the Default Membership once logged-in.

    However, if they login via social on a protected-content page, they are redirected back to that same URL after logging in. So they think they still don't have access. If they go directly to the URL of that page when logged-in, they have access as expected.

    So we're now looking for some way to force the social login plugin to read only the redirect_to portion of the URL so it correctly redirects back to the actual page once logged-in.

    I've asked our 2nd-level support team to look into this. Please note that as they handle mostly complicated issues, this may take more time than a normal ticket.

  • Panos

    Hi Joel ,

    Apologies for delay here!

    Could you please try adding the following snipet on your child theme's functions.php file or a mu-plugin:

    add_action( 'user_register', function( $user_id ){
    	$membership_id = 178;
    	$member = MS_Factory::load( 'MS_Model_Member', $user_id );
    	$member->add_membership( $membership_id );
    }, 10 );

    You'll need to replace the membership id 178 with the id of the membership you need.

    Just one note, this will add any new user registered to this membership even if they register without the social login option (no sure how your site is structured :slight_smile: ).

    Hope this helps you accomplish what you need! If not, please provide more details so we work this out :slight_smile:


  • Joel

    Hi Guys,

    I found a fix for this. Ultimately the problem here was the redirect method used by the plugin (Wordpress Social Login). It redirects to the page that the user came from before being sent to the Facebook authentication process. Therefore the user was being redirected to the "protected content" page and it appeared that they did not have access although this was not the case. The users do have the proper access level as default Wordpress users or users with the role/group "subscribers".

    The solution is to turn off the content protection and use the membership short code to wrap the content. This way the user is redirected to the content page that they were attempting to access after authentication. Additionally, you must have the Wordpress Social Login shortcode outside the membership shortcode for obvious reasons.

    Make sure your OAUTH settings are on in the Facebook developer portal and that your redirect URLs are whitelisted or authorized.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.