Tagged: bp-signup, code, email required registration, email-required, register
Is there a way to remove the line in the registration page for the email? I have the autologin plugin so the email actually doesn’t even matter I just want to hide it from the registration page.
Thank you!
Hi,
Welcome to BuddyDev forums.Even though the auto activation is enabled, WordPress users must have an email address associated with their account. WordPress will not allow user registration if the email address is not specified.
In other words, It is possible to overcome this by specifying an email on invalid domain but you can not remove the requirement completely.
Please do note that specifying the invalid email will make accounts inaccessible and difficult to identify when they forget password.
Regards
BrajeshThank you for the reply!
Is there a way to have the email section automatically filled out with a random email? I don’t want people to put in personal ones.
I will have note about visitors writing down their username and password
Hi,
You can put the following code in your theme’s functions.php or in the wp-content/plugins/bp-custom.php/** * Update BuddyPress signup email to an invalid address */ function buddydev_update_bp_signup_email() { // we use the username to create emails, It is needed. if ( empty( $_POST['signup_username'] ) ) { return; } $temp_email = $_POST['signup_username'] . random_int( 1, 1000 ) . '@example.com'; $_POST['signup_email'] = $temp_email; } add_action( 'bp_signup_pre_validate', 'buddydev_update_bp_signup_email' );
That removes the email from requirement.
You will need to hide email field though.
Here is css
label[for="signup_email"], #signup_email{ display:none !important; }
You can use the css or simply remove the fields form register.php
Hope this helps.
Regards
BrajeshI am getting the error:
Your PHP code changes were rolled back due to an error on line 608 of file wp-content/themes/twentyseventeen/functions.php. Please fix and try saving again.
syntax error, unexpected ‘&’, expecting ‘]’
It’s talking about line ” if ( empty( $_POST['signup_username'] ) ) {“
- This reply was modified 6 years, 9 months ago by salsathe4th.
Please make sure that you copy the code from the topic here and not from the mail.
The code sent on email notification is entity encoded and will cause issue.
Please check if copying from here works or not?
Regards
Brajesh
The topic ‘ [Resolved] Can I remove the email address (required) from reg (I have autologin plugin)’ is closed to new replies.