Possible to Remove Name Fields from Registration?

Hi, this question is for a client who is considering purchasing WPMU Membership at my request.

He wants to have a membership site but only collect the bare minimum of personal information about the customers - username, password, and email.

I see that First and Last Name are required fields on the registration forms for Memberpress. Is it possible to remove those requirements? I have not seen any threads or info about this.

It looks like Wishlist and Memberpress do have this feature, but I would prefer he go with WPMU as I feel he'll be better served. Let me know.

Thanks very much for your time.

  • Vaughan

    Hi @terranova23,

    Welcome to the forum.

    You would need to edit the plugin code to do this.

    First off, you would need to edit membership/classes/Membership/Render/Page/Registration/Standard.php

    Then remove the first_name & last_name sections from the function _render_standard_form()

    Not sure if there's anywhere exactly, couldn't seem to find the validation for it, it might depend on the gateway used. Let me just ask one of our developers to see if he can point you in the right direction for this.

    Hope this helps

  • Saurabh

    Hi @terranova23,

    Hope you are well today.

    Removing the first name and last name fields is not there by default because like @Vaughan says, it affects the payment gateway processing. However, only in a few cases are these required fields.

    Removing these is possible with a few modifications. However, I'll need a little time to explore the effects of that and consult the developer on how we may be able to make this more granular in the future.

    I'll update this thread with a quick fix for you, asap. Hopefully we'd be able to update the plugin itself so it may work without these fields, by default.

    Thank you for your patience.



  • Jack Kitterhing

    Hi there @terranova23,

    Hope you're well today and I apologize about the extreme delay on this.

    I've just taken a look at this for you and while the code is used for the gateways with the first and last name), this isn't effected by that on signup.

    So if you use the pop up form for example you can modify the plugin and remove the following code

    						<label for="reg_first_name"><?php _e( 'First Name', 'membership' ) ?></label>
    						<input type="text" value="<?php echo esc_attr( filter_input( INPUT_POST, 'first_name' ) ) ?>" class="regtext" x-autocompletetype="given-name" name="first_name" id="reg_first_name">
    						<label for="reg_last_name"><?php _e( 'Last Name', 'membership' ) ?></label>
    						<input type="text" value="<?php echo esc_attr( filter_input( INPUT_POST, 'last_name' ) ) ?>" class="regtext" x-autocompletetype="family-name" name="last_name" id="reg_last_name">

    Which can be found on lines 75-83, in membership > classes > Membership > Render > Page > Registration > Popup.php

    Please be aware that upon a plugin update, the code changes would be lost.

    Thank you!

    Kind Regards

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.