LifterLMS Custom Fields: Collect Extra Student Information

Add extra questions such as job role, company or employee number to LifterLMS checkout, registration and account forms, with the Custom Fields add-on or a few lines of code, and then use the answers.

  • Add as a preferred source on Google
Illustration for “LifterLMS Custom Fields: Collect Extra Student Information”

Sooner or later you need to know more about your students than a name and an email address. A training company wants the employer and job title. A continuing education provider needs a licence number. A school wants the year group. LifterLMS custom fields let you ask for that information on the forms students already fill in, and keep the answers on their user account.

This guide explains what the free plugin can and cannot do with forms, when the paid Custom Fields add-on is the right answer, and how a developer can add fields with a filter instead. Then it covers the part most tutorials skip: getting the data back out and using it.

It assumes LifterLMS is installed and your checkout works. For the forms themselves, start with our guide to LifterLMS registration and account forms.

The three forms and what core lets you change

LifterLMS keeps its student information forms under LifterLMS > Forms. There are three core forms, one for each place a student enters their details:

FormWhere it appears
CheckoutThe billing information step of checkout and free enrollment
RegistrationOpen registration on the student dashboard and the [lifterlms_registration] shortcode
AccountThe Edit Account area of the student dashboard

Each form is edited in the block editor. In the free plugin you can reorder fields, change labels and descriptions, set fields as required or optional, and add or remove the built-in user information fields: names, display name, email, password, the address fields and phone. That covers most "do we need the address?" decisions.

What the free plugin does not give you is new kinds of questions. A dropdown of job roles, a checkbox list of interests or a text box for a licence number are custom fields, and they need either the Custom Fields add-on or code. The forms screen itself says so with a "Create Custom Forms and Fields" notice that points to the add-on.

Decide what to collect before you build

Every extra field costs you some conversions at checkout, and under privacy law every field you store is data you are responsible for. Before adding anything, answer three questions for each field:

  1. What will we do with it? If nobody can name a report, email or rule that uses the answer, leave it out.
  2. When do we need it? Information needed to deliver the course belongs on checkout. Nice-to-know profile details can go on the Account form, where students fill them in later.
  3. Is it the same for every product? If a corporate course needs an employee number but a public course does not, you need different forms for different products. That is an add-on feature, covered below.

Our LifterLMS GDPR and privacy guide covers consent, retention and data export in more detail.

Option 1: the LifterLMS Custom Fields add-on

The LifterLMS Custom Fields add-on is the no-code route. Once it is active, the block inserter on the form editor offers extra field types. According to the add-on documentation these include text, textarea, dropdown, checkboxes, radio buttons, number, email, phone number, website URL and an input confirmation field.

Add a field

  1. Go to LifterLMS > Forms and edit the form you want to change.
  2. Click the block inserter and choose a field type.
  3. Type the label and, if it helps, a short description under the field.
  4. Use the block settings sidebar for options such as the list of choices and whether the field is required.
  5. Save the form, then test it in a private browser window as a new visitor.

Different forms for different products

The add-on also lets you create extra checkout forms with Add New Form and assign them to particular courses, memberships or access plans. This is the clean way to ask corporate buyers for a company name without putting that question in front of everyone else.

Choose the add-on when site managers need to change questions themselves, or when you need per-product forms. Choose code when the field list is stable and you want it under version control.

Option 2: add fields with the lifterlms_get_person_fields filter

LifterLMS has a filter for adding fields to a form programmatically. It receives the list of extra fields and the form location (checkout, registration or account). Each field is an array of settings for the core field class, and fields with a data_store of usermeta are saved to the user's meta automatically when the form is submitted.

This example adds a required job role dropdown and an optional employee number to all three forms. Put it in a small custom plugin, not in a theme that might be replaced.

<?php
/**
 * Plugin Name: LLMSX Student Profile Fields
 */

add_filter( 'lifterlms_get_person_fields', 'llmsx_add_person_fields', 10, 2 );
function llmsx_add_person_fields( $fields, $location ) {

	$fields[] = array(
		'id'             => 'llmsx_job_role',
		'name'           => 'llmsx_job_role',
		'type'           => 'select',
		'label'          => __( 'Job role', 'llmsx' ),
		'required'       => true,
		'data_store'     => 'usermeta',
		'data_store_key' => 'llmsx_job_role',
		'options'        => array(
			''           => __( 'Select your role', 'llmsx' ),
			'manager'    => __( 'Manager', 'llmsx' ),
			'specialist' => __( 'Specialist', 'llmsx' ),
			'other'      => __( 'Other', 'llmsx' ),
		),
	);

	$fields[] = array(
		'id'             => 'llmsx_employee_number',
		'name'           => 'llmsx_employee_number',
		'type'           => 'text',
		'label'          => __( 'Employee number', 'llmsx' ),
		'description'    => __( 'Six digits, found on your staff badge.', 'llmsx' ),
		'required'       => false,
		'data_store'     => 'usermeta',
		'data_store_key' => 'llmsx_employee_number',
	);

	return $fields;
}

The fields appear after the fields you placed in the block editor. On the Account form they are pre-filled from the saved user meta, so students can correct their answers later. Text values are sanitised as plain text by the form handler before they are stored.

Validate the answers

Required fields are checked for you. For a format rule, hook into the validation filter. Its name depends on the action: lifterlms_user_registration_data for new users and lifterlms_user_update_data for existing users updating their details. Return a WP_Error to stop the submission and show the message on the form.

add_filter( 'lifterlms_user_registration_data', 'llmsx_validate_employee_number', 10, 3 );
add_filter( 'lifterlms_user_update_data', 'llmsx_validate_employee_number', 10, 3 );
function llmsx_validate_employee_number( $valid, $posted_data, $location ) {

	if ( is_wp_error( $valid ) || empty( $posted_data['llmsx_employee_number'] ) ) {
		return $valid;
	}

	if ( ! preg_match( '/^\d{6}$/', $posted_data['llmsx_employee_number'] ) ) {
		return new WP_Error(
			'llmsx_employee_number',
			__( 'Your employee number must be six digits.', 'llmsx' )
		);
	}

	return $valid;
}

Use the $location argument if a rule should only apply on one form, such as checkout.

Use the data after you collect it

Collected data is only worth something if it is used. Both options above store answers as WordPress user meta, so everything that can read user meta can read them.

Show it to the student

The core [llms-user] shortcode prints a field for the logged-in user, with a fallback when it is empty:

Welcome back. Your registered role: [llms-user key="llmsx_job_role" or="not set"]

It works for any user or user meta key except the password, and it only ever shows the current user's own data. It prints the stored value, so for a dropdown you will see the option key, such as manager, not the label. Use readable keys.

Use it in your own code

Read a value with get_user_meta( $user_id, 'llmsx_job_role', true ). Typical uses are enrolling managers in an extra course after checkout, adding a line to a certificate template, or filtering a custom report.

Send it to other systems

CRM connectors such as WP Fusion can usually map user meta keys to CRM fields. Automation tools can read it from your own endpoint or a webhook. Note that the LifterLMS REST API does not expose arbitrary user meta on the students route; a developer can add it with register_rest_field() if an integration needs it.

Where it does not appear

Do not expect custom fields to show up everywhere automatically. The extra LifterLMS section on the WordPress user profile screen shows the core user information fields, such as address and phone, not fields you added yourself. Admins who need to see or edit them should have a small profile field added, or use the add-on's tools if it provides them. Check this before you promise the client "it will be on the user screen".

Common mistakes

  • Too many required fields at checkout. Every required question is a reason to abandon a purchase. Ask for profile details on the Account form instead, unless you need them to deliver the course.
  • Changing the meta key later. Old answers stay under the old key. Pick a prefixed, permanent key on day one, such as llmsx_job_role.
  • Using a meta key LifterLMS already uses. Keys like first_name or llms_billing_city belong to core fields. Prefix yours.
  • Collecting sensitive data casually. Health details, dates of birth and ID numbers raise your privacy obligations. Collect them only with a clear purpose and a retention plan.
  • Testing only as an admin. Logged-in admins see the update version of the form. Test checkout and registration in a private window as a new visitor, then test the Account form as that student.

Frequently asked questions

Does free LifterLMS support custom registration fields?

Not through the form editor. The free plugin lets you edit the core user information fields. New field types and extra forms come with the Custom Fields add-on, or a developer can add fields with the lifterlms_get_person_fields filter.

Where are custom field answers stored?

In the WordPress user meta table, under the key set for the field. That makes them easy to read with standard WordPress functions and to include in exports.

Can I show a field only for certain courses?

With the add-on, create a separate form and assign it to those courses or access plans. In code, you would need to detect the product being purchased, which is fiddlier; the add-on is usually the better choice here.

Will custom fields survive a LifterLMS update?

Yes. Fields added with the add-on are stored with the form, and fields added by your own plugin are re-added on every request. Neither is lost when LifterLMS updates.

Next steps

List the questions you want to ask and, next to each, the report or automation that will use the answer. Delete the ones without a use. Then pick the route: the add-on if non-developers will manage the forms or you need per-product forms, the filter if the list is short and stable.

If the data needs to drive enrollments, certificates, CRM fields or reports, it is worth planning that end to end. Our LifterLMS customization service builds and maintains this kind of form logic, and you can tell us what you need to collect to get a recommendation.

Add LifterLMS Expert to your preferred sources

Add lifterlmsexpert.com as a preferred source on Google, or open this article in your AI assistant to use it as a source.

  • Add as a preferred source on Google
Free consultation

Prefer expert help over DIY?

Skip the trial and error. Get specialist LifterLMS help and ship faster.

Talk to a LifterLMS Expert Explore our services

Replies within one business day