MB User Profile
MB User Profile helps you to add information to the user profile and edit these details on the front end. It also includes a register form, login form, and edit profile form that you can embed anywhere using shortcodes.

Note: this extension already includes MB User Meta.
Registration form
To insert a registration form to a page, select the Registration Form block from the block inserter. And you'll see the form preview like this:

Clicking on the block will reveal the form settings on the right. All settings are self-explained and have their description.
You can also use the registration shortcode to display the registration form:
[mb_user_profile_register]
Below is the list of the settings. The attribute is used for the shortcode.
| Name | Attribute | Description |
|---|---|---|
| ID | id | Field group ID(s) created for users, separated by commas. Optional. Leave blank to show the default registration form. |
| Redirect URL | redirect | Redirect URL, to which users will be redirected after a successful registration. |
| Form ID | form_id | ID (HTML attribute) of the form. |
| Title | label_title | Label for the title of the form. Default empty. |
| Username field label | label_username | Label for the username input field. |
| Email field label | label_email | Label for the email input field. |
| Password field label | label_password | Label for the password input field. |
| Confirm password field label | label_password2 | Label for the confirm password input field. |
| Submit button text | label_submit | Label for the submit button. |
| Username field ID | id_username | ID (HTML attribute) of the username input field. |
| Email field ID | id_email | ID (HTML attribute) of the email input field. |
| Password field ID | id_password | ID (HTML attribute) of the password input field. |
| Confirm password field ID | id_password2 | ID (HTML attribute) of the confirm password input field. |
| Submit button ID | id_submit | ID (HTML attribute) of the submit button. |
| Confirmation text | confirmation | Confirmation message if registration is successful. |
| Send confirmation email | email_confirmation | Send a confirmation email when registering (you need to set up an email SMTP to make this function work properly). If this param is true, the system will also check the confirmation status when the user login. All previous users are set and confirmed. |
| Password strength | password_strength | Set the required password strength. Available options: strong, medium, weak, very-weak, or false to disable password strength meter. |
| Use email for username | email_as_username | Use email for username. If this param is true, then the username field will disappear. |
| Always show | show_if_user_can | Always show the form if the current user has the proper capability. Should be a WordPress capability. Useful if admins want to register for other people. |
| Role for the new user | role | Role for the new user. If append_role is set to true, then the new role is appended, so users will have 2 roles: the default roles set by WordPress and this role. Default empty. The role must be in the Allowed registration roles setting. If it is not, the new user gets the Subscriber role. See Settings. |
| Append role | append_role | Whether to append the role to users instead of setting only one role for users. |
| Captcha provider | captcha_provider | Captcha provider for the form. Use recaptcha for Google reCAPTCHA v3 or turnstile for Cloudflare Turnstile. Optional. |
| Site key | captcha_key | Site key for the selected captcha provider. Optional. |
| Secret key | captcha_secret | Secret key for the selected captcha provider. Optional. |
Login form
To insert a login form to a page, select the Login Form block from the block inserter. And you'll see the form preview like this:

Clicking on the block will reveal the form settings on the right. All settings are self-explained and have their description.
You can also use the login shortcode to display the login form:
[mb_user_profile_login]
Below is the list of the settings. The attribute is used for the shortcode.
| Name | Attribute | Description |
|---|---|---|
| Redirect URL | redirect | Redirect URL, to which users will be redirected after successful login. |
| Form ID | form_id | ID (HTML attribute) of the form. |
| Title | label_title | Label for the title of the form. Default empty. |
| Username field label | label_username | Label for the username input field. |
| Password field label | label_password | Label for the password input field. |
| Remember checkbox label | label_remember | Label for the remember checkbox field. |
| Lost password field label | label_lost_password | Label for the lost password link. |
| Submit button text | label_submit | Label for the submit button. |
| Username field ID | id_username | ID (HTML attribute) of the username input field. |
| Password field ID | id_password | ID (HTML attribute) of the password input field. |
| Remember checkbox ID | id_remember | ID (HTML attribute) of the remember checkbox field. |
| Submit button ID | id_submit | ID (HTML attribute) of the submit button. |
| Confirmation text | confirmation | Confirmation message if login is successful. |
| Default username value | value_username | Default value for the username field. |
| Default remember | value_remember | Default value for the remember checkbox field - true or false (default). |
| Captcha provider | captcha_provider | Captcha provider for the form. Use recaptcha for Google reCAPTCHA v3 or turnstile for Cloudflare Turnstile. Optional. |
| Site key | captcha_key | Site key for the selected captcha provider. Optional. |
| Secret key | captcha_secret | Secret key for the selected captcha provider. Optional. |
Edit profile form
To insert an edit profile form to a page, select the Edit Profile Form block from the block inserter. And you'll see the form preview like this:

Clicking on the block will reveal the form settings on the right. All settings are self-explained and have their description.
You can also use the edit profile shortcode to display the edit profile form:
[mb_user_profile_info id="field-group-id"]
Below is the list of the settings. The attribute is used for the shortcode.
| Name | Attribute | Description |
|---|---|---|
| ID | id | Field group ID(s) created for users, separated by commas. All fields from field groups will be included in the profile form. Required. |
| User ID | user_id | User ID, whose info will be edited. If not specified, the current user ID is used. |
| Redirect URL | redirect | Redirect URL, to which users will be redirected after successful submission. |
| Form ID | form_id | ID (HTML attribute) of the form. |
| Title | label_title | Label for the title of the form. Default empty. |
| Password field label | label_password | Label for the password input field. |
| Confirm password field label | label_password2 | Label for the confirm password input field. |
| Submit button text | label_submit | Label for the submit button. |
| Password field ID | id_password | ID (HTML attribute) of the password input field. |
| Confirm password field ID | id_password2 | ID (HTML attribute) of the confirm password input field. |
| Submit button ID | id_submit | ID (HTML attribute) of the submit button. |
| Confirmation text | confirmation | Confirmation message if the form submission is successful. |
| Password strength | password_strength | Set the required password strength. Available options: strong, medium, weak, very-weak, or false to disable password strength meter. |
| Captcha provider | captcha_provider | Captcha provider for the form. Use recaptcha for Google reCAPTCHA v3 or turnstile for Cloudflare Turnstile. Optional. |
| Site key | captcha_key | Site key for the selected captcha provider. Optional. |
| Secret key | captcha_secret | Secret key for the selected captcha provider. Optional. |
Default fields
By default, the user profile form doesn't include any default user fields, such as first name, last name, or biography. To be able to edit these fields, please create a field group for users with those fields, keeping the same field IDs as WordPress's.
For example, the code below creates a meta box for editing the user's first name, last name, and biography:
add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) {
$meta_boxes[] = [
'title' => 'Default Fields',
'id' => 'default-fields',
'type' => 'user', // NOTICE THIS
'fields' => [
[
'id' => 'first_name',
'name' => 'First Name',
'type' => 'text',
],
[
'id' => 'last_name',
'name' => 'Last Name',
'type' => 'text',
],
[
'id' => 'description',
'name' => 'Biography',
'type' => 'textarea',
],
],
];
return $meta_boxes;
} );
And use it in the user edit profile form with this shortcode:
[mb_user_profile_info id="default-fields"]
To make the plugin recognize the user fields, you need to set the correct ID for them:
| Field | ID |
|---|---|
| User email | user_email |
| User nicename | user_nicename |
| User URL | user_url |
| Display name | display_name |
| First name | first_name |
| Last name | last_name |
| Registration date | user_registered |
| Biography | description |
| Rich editing | rich_editing |
| Syntax highlighting | syntax_highlighting |
| Admin color | admin_color |
| Comment shortcuts | comment_shortcuts |
| Show the admin bar on the front | admin_bar_front |
| User role | role |
These default fields do not work as sub-fields in a group.
User password
To let users change their password, please use the field group ID rwmb-user-info in the shortcode below:
[mb_user_profile_info id="rwmb-user-info"]
Spam protection
MB User Profile supports two captcha providers:
- Google reCAPTCHA v3
- Cloudflare Turnstile
To enable captcha protection, set the captcha_provider attribute and then enter the matching site key (captcha_key) and secret key (captcha_secret) for that provider:
Example for the registration form with Google reCAPTCHA v3:
[mb_user_profile_register captcha_provider="recaptcha" captcha_key="your_site_key" captcha_secret="your_secret_key"]
Example for the registration form with Cloudflare Turnstile:
[mb_user_profile_register captcha_provider="turnstile" captcha_key="your_site_key" captcha_secret="your_secret_key"]
The same captcha attributes are available for the login form and edit profile form.
The old reCAPTCHA-specific keys have been migrated to the new provider-based key fields:
recaptcha_keyis now thecaptcha_keyfieldrecaptcha_secretis now thecaptcha_secretfield
These old attribute names still work for backward compatibility.
Settings
MB User Profile has a settings page at Meta Box » User Profile.

The settings page has these settings:
- Enable limit login attempts: block an IP address for 1 hour after 3 failed login attempts. See Limit login attempts.
- Force password change: make new users change their password after their first login.
- Allowed registration roles: the roles that the registration form can give to new users. The default role is Subscriber. See Allowed registration roles.
- Email confirmation success page: the page that shows when a user confirms their email. If you do not select a page, the plugin shows a default message.
- Email confirmation error page: the page that shows when the email confirmation fails. If you do not select a page, the plugin shows a default message.
Limit login attempts
This setting protects your site from attacks that try many passwords. When the setting is on:
- After 3 failed login attempts from an IP address, the plugin blocks that IP address for 1 hour.
- The block applies to all login forms on the site, also to
wp-login.php. - A blocked user sees the message "Too many failed login attempts. Please try again in 1 hour."
- A successful login resets the count of failed attempts.
To turn on the setting:
- Go to Meta Box » User Profile.
- Turn on Enable limit login attempts.
- Click Save Settings.
The plugin counts failed attempts for each IP address. If your site is behind a proxy or a CDN, all visitors can have the same IP address. In this case, make sure that your server gives the real IP address of the visitor to WordPress.
Allowed registration roles
The role attribute of the registration form sets the role of new users. For security, the plugin gives a role to new users only if the role is in the Allowed registration roles setting. If the role is not in the setting, the new user gets the Subscriber role.
To let the registration form give a role other than Subscriber:
- Go to Meta Box » User Profile.
- In Allowed registration roles, select the roles.
- Click Save Settings.
For example, to register new users as authors, select Author in the setting and use this shortcode:
[mb_user_profile_register role="author"]
Before version 2.7.0, the registration form accepted all roles. If your registration form uses the role attribute with a role other than Subscriber, add that role to the setting after you update the plugin.
Email templates
MB User Profile sends emails to users when:
- They reset their passwords
- They register and are requested to confirm by email
To overwrite the emails created by the plugin, please:
- Create a folder
mb-user-profilein your theme (or your child theme) - Copy the email templates from the MB User Profile's
templatesfolder to themb-user-profilefolder that you've just created above - Edit the new templates files
Now the emails sent by the plugin will use the templates in your theme.
Hooks
rwmb_profile_redirect
This filter allows you to change the URL of the redirect page after the form is submitted. It accepts 2 parameters: redirect URL and form config - the shortcode attributes.
$redirect = apply_filters( 'rwmb_profile_redirect', $redirect, $config );
You can use this filter to change the redirect URL after a user updated his profile.
add_filter( 'rwmb_profile_redirect', function( $redirect, $config ) {
if ( 'my-meta-box' === $config['id'] ) {
$redirect = 'https://domain.com/thank-you/';
}
return $redirect;
}, 10, 2 );
rwmb_profile_before_process
This action fires before the form is processed. It accepts one parameter $config - the form configuration, taken from the shortcode attributes.
rwmb_profile_after_process
This action fires after the form is processed, e.g. saved or updated. It accepts 2 parameters:
$config- the form configuration, taken from the shortcode attributes.$user_id- the submitted user ID
You can use this action to do a custom redirect to your Thank you page or send an email notification.
add_action( 'rwmb_profile_after_process', function( $config, $user_id ) {
if ( 'my-meta-box' === $config['id'] ) {
wp_safe_redirect( 'thank-you' );
die;
}
}, 10, 2 );
rwmb_profile_before_form
This action fires before form output. It accepts one parameter $config - the form configuration, taken from the shortcode attributes.
rwmb_profile_after_form
This action fires after form output. It accepts one parameter $config - the form configuration, taken from the shortcode attributes.
rwmb_profile_before_display_confirmation
This action fires before the confirmation message is displayed. It accepts one parameter $config - the form configuration, taken from the shortcode attributes.
rwmb_profile_after_display_confirmation
This action fires after the confirmation message is displayed. It accepts one parameter $config - the form configuration, taken from the shortcode attributes.
rwmb_profile_before_submit_button
This action fires before the submit button is displayed. It accepts one parameter $config - the form configuration, taken from the shortcode attributes.
rwmb_profile_after_submit_button
This action fires after the submit button is displayed. It accepts one parameter $config - the form configuration, taken from the shortcode attributes.
rwmb_profile_info_submit_button and rwmb_profile_register_submit_button
These filters change the HTML of the submit button in the edit profile form and the register form. They accept 2 parameters: the button HTML and $config - the form configuration.
add_filter( 'rwmb_profile_register_submit_button', function ( $button, $config ) {
return str_replace( 'class="rwmb-button"', 'class="rwmb-button my-button"', $button );
}, 10, 2 );
rwmb_profile_validate
This filter is used to check if the form is validated. You can use this filter to add a custom check for the data before it's processed.
If you return any value other than true, the form will not be processed and the error message will be displayed. So, you can return a string as an error message.
$is_valid = apply_filters( 'rwmb_profile_validate', $is_valid, $config );
Example:
add_filter( 'rwmb_profile_validate', function ($is_valid) {
$email = $_POST['user_email'] ?? '';
$is_valid = 'Email is already taken';
}
return $is_valid;
} );
rwmb_profile_insert_user_data
This filter is used to modify the submitted user data before it's passed to the wp_insert_user function to create a new user. It accepts 2 parameters: the array of user data and the shortcode parameters.
$data = apply_filters( 'rwmb_profile_insert_user_data', $data, $config );
Please note that this filter works only for default user fields such as user email or password. For changing custom field data, please use rwmb_{$field_id}_value filter.
The array keys are the parameters of wp_insert_user(), for example user_login, user_email, and first_name. The array has only the fields that the user fills in.
This example uses the email as the username, and the first and last name as the display name:
add_filter( 'rwmb_profile_insert_user_data', function ( $data, $config ) {
if ( ! empty( $data['user_email'] ) ) {
$data['user_login'] = $data['user_email'];
}
$name = trim( ( $data['first_name'] ?? '' ) . ' ' . ( $data['last_name'] ?? '' ) );
if ( $name ) {
$data['display_name'] = $name;
}
return $data;
}, 10, 2 );
rwmb_profile_update_user_data
This filter is used to modify the submitted user data before it's passed to the wp_update_user function to update an existing user. It accepts 2 parameters: the array of user data and the shortcode parameters.
$data = apply_filters( 'rwmb_profile_update_user_data', $data, $config );
Please note that this filter works only for default user fields such as user email or password. For changing custom field data, please use rwmb_{$field_id}_value filter.
The array keys are the parameters of wp_update_user(). The plugin adds the user ID (ID) after the filter.
This example stops users from changing their email:
add_filter( 'rwmb_profile_update_user_data', function ( $data, $config ) {
unset( $data['user_email'] );
return $data;
}, 10, 2 );
Default form fields
To modify the default register, login, or edit profile form fields, please use the following filters:
$fields = apply_filters( 'rwmb_profile_register_fields', $fields );
$fields = apply_filters( 'rwmb_profile_login_fields', $fields );
$fields = apply_filters( 'rwmb_profile_info_fields', $fields );
$fields = apply_filters( 'rwmb_profile_lost_password_fields', $fields );
$fields = apply_filters( 'rwmb_profile_reset_password_fields', $fields );
Example: change the label of the username field in the lost password form:
add_filter( 'rwmb_profile_lost_password_fields', function ( $fields ) {
$fields['username']['name'] = 'Your email';
return $fields;
} );
rwmb_profile_before_save_user
This action fires before the user is created or updated.
do_action( 'rwmb_profile_before_save_user', $object );
The action accepts 1 parameter: the instance of the MB_User_Profile_User class, which handles the submission. It has the following public properties that you can use:
$user_id: The submitted user ID$config: The configuration, taken from the shortcode attributes
For a new user, $user_id is empty, because the plugin did not create the user yet.
This example writes a log entry for each profile update:
add_action( 'rwmb_profile_before_save_user', function ( $user ) {
if ( $user->user_id ) {
error_log( 'User ' . $user->user_id . ' is updating the profile.' );
}
} );
rwmb_profile_after_save_user
This action fires after the user is created or updated. At that time, all the custom fields in the meta box are already saved into the user meta.
do_action( 'rwmb_profile_after_save_user', $object );
The action accepts 1 parameter: the instance of the MB_User_Profile_User class, which handles the submission. It has the following public properties that you can use:
$user_id: The submitted user ID$config: The configuration, taken from the shortcode attributes
This action fires for the registration form and for the edit profile form. If an error stops the save, $user_id is empty.
This example adds a member ID to each new user. A profile update does not change the member ID:
add_action( 'rwmb_profile_after_save_user', function ( $user ) {
if ( ! $user->user_id || get_user_meta( $user->user_id, 'member_id', true ) ) {
return;
}
update_user_meta( $user->user_id, 'member_id', 'M-' . $user->user_id );
} );
This example sends an email to the admin when a user registers with the form of the member-info meta box:
add_action( 'rwmb_profile_after_save_user', function ( $user ) {
if ( ! $user->user_id || ! str_contains( $user->config['id'] ?? '', 'member-info' ) ) {
return;
}
$info = get_userdata( $user->user_id );
wp_mail( get_option( 'admin_email' ), 'New member', 'New member: ' . $info->user_email );
} );
Known issues
Upload files/images
To be able to upload files or images (via fields file_advanced, file_upload, image_advanced, image_upload), users have to log in and proper capability upload_files to access the Media Library. If your users don't have that capability (like if they have the subscriber role), then the upload fields don't work. In that case, you can add the capability for that role as follows:
add_action( 'init', function () {
$subscriber = get_role( 'subscriber' );
$subscriber->add_cap( 'upload_files' );
} );
Another solution is using file or image fields. Both of them work similarly. They just don't have a nice UI, but they do the job very well.
Styling
The extension outputs the default fields' HTML with CSS comes from the Meta Box plugin. The style is basic and works in most cases. However, to make it match perfectly with your theme's style, you need to do some work with CSS.
Caching
As you might know, Meta Box uses nonces to prevent misuse or malicious requests. As the nonce fields are outputted directly in the HTML, they might be cached by caching plugins such as W3 Total Cache, WP Super Cache, etc. And thus, the verification of the nonce might not work properly and break the form submission. In this case, please do not cache the page where the form is embedded (caching plugins allow you to do that).