User ManagementPRO

This knowledge base article relates to the WS Form User Management add-on. Click here to purchase this add-on.

The ‘User Management’ action allows you to perform various WordPress user management functions, including:

  • Register
  • Edit Profile
  • Log In
  • Forgot Password
  • Reset Password
  • Log Out

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 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:

  1. Click ‘WS Form’ in the WordPress administration menu.
  2. Click ‘Add New’.
  3. Select the ‘User Management’ tab at the top of the page.
  4. Click on any of the user management methods to create a form.
  5. 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:

  1. When editing your form, click the ‘Actions’ icon at the top of the page. The ‘Actions’ sidebar will open on the right-hand side of the page.
  2. Click the ‘Add’  icon to add a new action.
  3. 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:

  1. Click the ‘Add’  icon at the bottom right of the field mapping section.
  2. In the left-hand column, select your form field.
  3. In the right-hand column, select the corresponding user management method field.
  4. Repeat this process for each field on your form.
  5. 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:

  1. Click the ‘Add’  icon at the bottom right of the meta mapping section.
  2. Select your form field.
  3. Select the user meta key you would like to create / update using the form field.
  4. Repeat this process for each field on your form.
  5. 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.

Role (Register Method)

Choose the role of newly registered users.

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.

Error Messages

WS Form PRO processes any error messages received from WordPress as standard WS Form messages. The error message settings match those of the ‘Show Message‘ action. You can configure these options to change how the error messages are displayed to users.

Most error messages come directly from WordPress, but some have been modified to avoid direct links to the standard WordPress login or forgot password screen.

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:

  1. Click the form settings  icon in the top toolbar when editing a form.
  2. Click on the ‘Populate’ tab.
  3. Check the ‘Populate Using Action’ setting.
  4. Select ‘User Management’ from the ‘Action To Populate From’ dropdown.
  5. 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.
  6. 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:

  1. Drag a ‘Hidden’ field to your form (We suggest adding it under the ‘Submit’ button).
  2. In the ‘Default Value’ setting, enter: #query_var("r").
  3. Make a note of the Field ID shown in the top right, for example, #123.
  4. Click ‘Save’ at the bottom.
  5. Click the ‘Actions’ icon at the top of the page. The ‘Actions’ sidebar will open on the right-hand side of the page.
  6. Click the ‘Add’  icon to add a new action.
  7. Select ‘Redirect to a Page’ from the Action pulldown. A series of settings will appear.
  8. 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.
  9. 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.