The ‘User Management’ action allows you to perform various WordPress user management functions, including:
- Register
- Edit Profile
- Log In
- Forgot Password / Reset Password (Read the tutorial here)
- Log Out
This add-on is also compatible with the following plugins:
About WordPress User Records
In WordPress, there are two tables in the database that store information about users. The wp_users table stores basic information about users (first name, last name, email etc), whereas the wp_usermeta table is used to store additional information about them, for example, custom fields that you create yourself.
The ability to manage custom user fields is not native to WordPress so you will need to use a plugin to configure them. We recommend using the Advanced Custom Fields (ACF) or Meta Box plugin.
The WS Form User Management add-on allows you to create and edit user meta data by mapping your form fields to meta keys.
Creating a User Management Form
Automatically (Recommended)
WS Form can create a form for any of the user management functions in a single click. This process not only creates a form but also fully configures WS Form so that the form is ready to use immediately.
To create a user management form in WS Form:
- Click ‘WS Form’ in the WordPress administration menu.
- Click ‘Add New’.
- Select the ‘User Management’ tab at the top of the page.
- Click on any of the user management methods to create a form.
- Wait a few moments while the form is created.
That’s it! Your form will be created and is ready to add to your website.
Tip: We recommend using the automatic method. Not only does this method create the form for you, but it also maps the fields and creates email actions suitable for these methods.
Manually
It is also possible to use any form created in WS Form and add an action so that it is submitted to the user management action when a user saves or submits their form.
To add a user management action:
- When editing your form, click the ‘Actions’ icon at the top of the page. The ‘Actions’ sidebar will open on the side of the page.
- Click the ‘Add’ icon to add a new action.
- Select ‘User Management’ from the Action pulldown. A series of settings will appear.
As with all sidebars in WS Form, click to the ‘Save’ button at the bottom to save your changes, or click ‘Cancel’ to disregard your changes.
The user management action settings are as follows:
When Should This Action Run?
You can choose to run the user management action when the form is saved, submitted, or both.
Method
Choose the method you like to run:
- Register
- Edit Profile
- Log In
- Forgot Password
- Reset Password
- Log Out
Field Mapping
Field mapping tells WS Form which of your form fields relate to the corresponding user management method. For example, you would want to map your Email field to the registration Email.
To map a field:
- Click the ‘Add’ icon at the bottom right of the field mapping section.
- In the left-hand column, select your form field.
- In the right-hand column, select the corresponding user management method field.
- Repeat this process for each field on your form.
- Click the ‘Save’ button at the bottom of the sidebar to save your changes.
Meta Mapping (Register & Update Methods)
The register and update user management methods provide the ability to map your form field to user metadata.
To map a field:
- Click the ‘Add’ icon at the bottom right of the meta mapping section.
- Select your form field.
- Select the user meta key you would like to create / update using the form field.
- Repeat this process for each field on your form.
- Click the ‘Save’ button at the bottom of the sidebar to save your changes.
Custom Meta Mapping
The add-on also supports setting custom meta keys to values.
To add a meta key-value pair:
- Click the ‘Add’ icon at the bottom right of the meta mapping section.
- Enter the meta key you would like to set a value for.
- Enter the meta value you would like to set the meta key to.
- Repeat this process for each meta key-value pair.
- Click the ‘Save’ button at the bottom of the sidebar to save your changes.
Disable the Visual Editor When Writing (Register Method)
The visual editor in WordPress provides a WYSIWYG interface for writing content. Some users who are comfortable writing basic HTML prefer to use the text editor. By checking this setting ,you can disable the visual editor for newly registered users.
Disable Syntax Highlighting When Editing Code (Register Method)
If checked, syntax highlighting will not be used.
Enable Keyboard Shortcuts for Comment Moderation (Register Method)
If checked, keyboard shortcuts will be enabled for comment moderation.
Show Toolbar in Viewing Website (Register Method)
If enabled the WordPress administration toolbar will be shown when the newly registered user logs in. For non-blog style websites, we recommend leaving this unchecked.
Create Password (If blank) (Register Method)
If no password fields are mapped, or the password is blank you can check this setting to automatically create a password for the newly registered user automatically. Note that this password is not accessible and only serves the purpose of allowing you to register users without them having to specify a password on the form. WordPress requires all newly created users to have a password so this features creates the password automatically. The password will need to be changed by the registered user once they have been added to the users database.
Password Length
If ‘Create Password’ is checked, you should specify the password length here. We recommend a minimum password length of 12 characters.
Password Special Characters
If checked, the automatically generated password will contain special characters. We recommend enabling this setting.
Send Email Notification (Register)
Choose whether or not to send new user notification emails. Available options are:
- None
- Administrator
- User
- User and Administrator
Admin Color Scheme
Choose the admin color scheme for the user. Available options are:
- Default
- Light
- Blue
- Coffee
- Ectoplasm
- Midnight
- Ocean
- Sunrise
Role (Register Method)
Choose the role of newly registered users.
Populating a Form with User Data
It is possible to pre-populate a form with WordPress user data using this add-on. This is useful for creating an ‘Edit Profile’ form.
To do this:
- Click the form settings icon in the top toolbar when editing a form.
- Click on the ‘Populate’ tab.
- Check the ‘Populate Using Action’ setting.
- Select ‘User Management’ from the ‘Action To Populate From’ dropdown.
- Use the field mapping and meta mapping to determine which fields and meta data you would like to populate into which fields of your form. Click the ‘Add’ icon to add new mappings.
- Click ‘Save’.
Creating a Login Redirect
It is possible to create a redirect for the login method, so that when a website visitor successfully logs in their browser they are taken to a URL of your choice.
Constant Redirect
If you want the redirect to be consistent, simply add a redirect action to the login form. For information about doing this, please see the ‘Redirect to a Page‘ action.
Dynamic Redirect
You can also pass a redirect URL to the login page to control the redirect URL dynamically. To do this:
- Drag a ‘Hidden’ field to your form (We suggest adding it under the ‘Submit’ button).
- In the ‘Default Value’ setting, enter:
#query_var("r")
. - Make a note of the Field ID shown in the top right, for example, #123.
- Click ‘Save’ at the bottom.
- Click the ‘Actions’ icon at the top of the page. The ‘Actions’ sidebar will open on the right-hand side of the page.
- Click the ‘Add’ icon to add a new action.
- Select ‘Redirect to a Page’ from the Action pulldown. A series of settings will appear.
- In the URL setting, enter:
#field(123)
where 123 is the Field ID of the hidden field you added. You can also click the variables icon to the right of the URL setting to find the field variable. - Click ‘Save’ at the bottom.
The login will now redirect to whatever the ‘r’ query string parameter is set to.
An example login URL would therefore be:
https://wsform.com/log-in/?r=%2Fwelcome%2F
This URL would redirect to /welcome/ after a successful login.
This same methodology can be used for any redirect action.