BuddyDev

BuddyPress Better Registration – Part 1

Recently, We have been getting a lot of request about BuddyPress registration experience customization.  In this series of 2 tutorials, we are going to explore all the possibilities and enhancements for the BuddyPress Registration process. I am not going to look customizing the appearance, only functionalities.

Make BuddyPress Use Username sitedwide instead of Fullname or display name:-

You don't want full name on registration page? You want to force users to use the username on the site instead of display name? That is fine. We can easily achieve it. We will restrict users from modifying the full name and fill username as full name.

Step 1:- Hide the full name field on Registration and Edit Profile page

Please visit Dashboard->Appearance->Customize->Additional CSS and add this css

It will hide full name field on the registration and edit profile page.

Here is how our registration form looked before applying css

And here it is after applying the css.

Step 2: – Pre-fill the full name field with username before signup validation. We are overwriting the full name field with username.

Step 3:- Removing the 'required' attribute from the full name form input field.

BuddyPress marks the input field for the full name as required. Even if we hide the field, all modern web browsers won't submit our form as a field marked as required is hidden. To overcome it, we remove 'required' from the input form field attribute

That's it. Now, go and try your register page. Create new user and see how it works.

Let's see one more trick for today.

Remove Confirm password box on the BuddyPress registration page:-

Step 1:- Hide the require password field and label using css as describe earlier.

Step 2:- Modify our function from previous step that hooks to signup validation and overwrite the confirm password with the entered password.

Here is the updated function.

That's it. Here is how the new registration form looks like.

The PHP code from this tutorial can be put in  wp-content/plugins/bp-custom.php or yourtheme/functions.php.

Hope you enjoyed this. In our next tutorial in the BuddyPress registration series, we will see how to avoid asking user for a username.

9 Responses to BuddyPress Better Registration – Part 1

  • Great!, thank you very much, Brajesh, the new registration form is exactly what I, any many others were looking for!

    Regards
    Carsten

    • Thank you Carsten.
      I sincerely appreciate your suggestion about the same in the forums.

      PS:- There was a small issue on confirm password, please make sure you use updated code.

      Regards
      Brajesh

  • Hi Brajesh, I get a HTTP ERROR 500 with this updated confirm password code:

    //Remove Confirm password box on the BuddyPress registration page

    Regards
    Carsten

    • This issue is unsolved

      • Hi Carsten,
        You are most probably adding both the functions from first snippet and last. You should replace the function from first snippet with it. They are same. The last version is an updated version of the first.

        PHP does not allow duplicate functions. That's why you are getting the error.

        Regards
        Brajesh

  • very cool boss thanks

  • Now the registration process has become much better, it is time for some styling.

    The registration is divided into an account- and a profile section with different styling.
    Is it possible to either join the two style sheets, or letting one of the sections inherit the style from the other, into one registration section?

    I had a code for a one column registration,but this is not working with Nouveau anymore.

    Regards
    Carsten