Gravity Forms and Membership Pro 2

I reading the membership pro 2 directions I am led to believe that I can use Gravity Forms for my registration form. As far as I can view, the only think I have to do is add add_filter('ms_frontend_handle_registration', '__return_false'); to functions.php file.

I don't see anywhere in MP2 where I designate the form as my registration form.

I I created my registration form using gravity forms and the user registration add-on. I filled out the form and basically, the only thing that occured is that a new user was created.
So Gravity Forms, as usual, did it's party
Where does Membership Pro 2 kick in?

  • Tyler Postle
    • CGO

    Hey Derek,

    Hope you're doing well today!

    What that filter does is disable the M2 registration process, so you can implement your own without it interfering.

    So now, with Gravity Forms you can create your form and use their user registration add-on then setup a redirect to the /memberships/ page or any other page you like. Perhaps you have setup your own custom membership page you want to send them too.

    You could also redirect them to a specific link to pay for a membership - so they don't need to select one still. ie:

    You may need to replace /register/ with whichever slug you have set in your MP register page selection.

    Gravity Forms allows for redirect conditionals, so you can set it up to redirect based on a field selection. If you have multiple memberships then create a field that allows them to select one and have it redirect to the payment page for that membership.

    Hope that helps! If you have any further questions just let us know.


  • Deryk
    • The Incredible Code Injector

    Thanks. I figured it out.

    Redirect in Gravity forms (notifications) to /register (or whatever you may have changed the register page to)

    Along with the code you recommend adding to the functions.php file - also add the following

    add_action( 'gform_user_registered', 'pi_gravity_registration_autologin', 10, 4 );
    * Auto login after registration.
    function pi_gravity_registration_autologin( $user_id, $user_config, $entry, $password ) {
    $user = get_userdata( $user_id );
    $user_login = $user->user_login;
    $user_password = $password;

    wp_signon( array(
    'user_login' => $user_login,
    'user_password' => $user_password,
    'remember' => false
    ) );

    With this the gravity form will continue on the redirected URL and, since it detects the user is already logged in, will take you directly to make your purchase.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.