Every LifterLMS Certificate Merge Code and How to Use It

A complete reference to LifterLMS certificate merge codes: what each one inserts, where the value comes from, when it is filled in, how to format dates and certificate numbers, and how to add your own codes and profile fields.

  • Add as a preferred source on Google
Illustration for “Every LifterLMS Certificate Merge Code and How to Use It”

LifterLMS certificate merge codes are the placeholders, such as {first_name} or {earned_date}, that turn one certificate template into a personal certificate for each student. There are twelve of them in core, plus a shortcode that reaches any field on the student's profile.

This reference lists every code, explains exactly where its value comes from and when it is filled in, and covers the details that cause most certificate support tickets: blank names, dates that change, and certificate numbers that do not look the way you want. It finishes with two short developer examples for custom codes. Everything here was checked against the LifterLMS 10.3 source.

If you are building your first certificate, start with how to create certificates in LifterLMS, then come back here for the details.

How certificate merge codes work

You type merge codes into the certificate template, which lives under Engagements > Certificates. In the block editor, the easiest way is the Merge Codes button in the toolbar of a text block: it opens a list called "LifterLMS Certificate Merge Codes" and inserts the code you pick, braces included.

When a student earns the certificate, LifterLMS copies the template into a new awarded certificate and replaces each code with that student's value. The awarded certificate is then a snapshot. Three things re-run the merge later:

  • Syncing an awarded certificate with its template, or all certificates from a template at once, from the Sync Awarded certificates panel on the template.
  • Updating an awarded certificate in the editor, which re-merges its content.
  • Previewing the template, which fills the codes with an administrator account's details so you can check the layout. The preview changes nothing for students.

Everything else, such as a student changing their name next month, has no effect on certificates already awarded until you sync them.

The complete list of LifterLMS certificate merge codes

Merge codeEditor labelWhat it inserts
{first_name}Student First NameThe First Name field on the WordPress user profile
{last_name}Student Last NameThe Last Name field on the profile
{student_name}Student Display NameThe profile's display name, the "Display name publicly as" choice
{email_address}Student EmailThe account email address
{user_login}Student UsernameThe WordPress username
{student_id}Student User IDThe numeric WordPress user ID
{earned_date}Earned DateThe date the certificate was awarded
{current_date}Current DateThe date the content was last merged
{certificate_id}Certificate IDThe awarded certificate's WordPress post ID
{sequential_id}Sequential Certificate IDA per-template running number, padded to six digits
{site_title}Site TitleYour site's title from Settings > General
{site_url}Site URLThe URL of your student dashboard page

The developer reference for llms_get_certificate_merge_codes() lists the same set.

The details behind each group of codes

Name codes: why names come out blank

{first_name} and {last_name} read the profile fields directly, with no fallback. If your registration or checkout form does not ask for names, they are empty, and the certificate reads "Presented to" followed by nothing.

Three ways to avoid it:

  1. Collect names at signup. Make first and last name required fields on your checkout and registration forms. Our guide to LifterLMS registration and account forms shows where to change them.
  2. Use {student_name}, the display name, which WordPress always has. It may be the username if the student never set a name, so it is a safety net rather than a perfect answer.
  3. Use the [llms-user] shortcode with a fallback, covered below: [llms-user first_name or="Student"].

Also think about formal names. Some students want a legal name on a certificate and a nickname everywhere else. If that matters, add a dedicated "Name on certificate" field and insert it with the shortcode or a custom code.

Date codes: earned date versus current date

Both dates use the Date Format from Settings > General, so change it there if you want "15 March 2026" instead of "March 15, 2026". The difference between them matters:

  • {earned_date} is the award date stored on the certificate. Syncing does not change it.
  • {current_date} is the date of the merge. At the moment of award it matches the earned date, but every sync or update re-merges it, so after a template change a certificate earned in January can suddenly show today's date.

Use {earned_date} on every certificate. The default template has done so since LifterLMS 6.1. Reserve {current_date} for unusual cases, such as a "printed on" line.

ID codes: certificate numbers and verification

{certificate_id} is the WordPress post ID of the awarded certificate. It is unique across the site but not consecutive, because WordPress uses the same ID sequence for all posts, pages and orders.

{sequential_id} is designed for certificate numbers. Each template keeps its own counter, which increments by one for each certificate awarded from it, and the number is padded with zeros to six digits, so the first certificate shows 000001. You can see and raise the next number in the template's Settings panel as Next Sequential ID. It cannot be set lower than the current value, so numbers are never reused.

Because counters are per template, two templates can both issue certificate 000042. If certificate numbers must be unique across your whole programme, add a template-specific prefix, as in the example below, or use one template.

A certificate number is only useful if someone can check it. Students can switch on Enable sharing on their certificate to get a public link, which an employer can open to see the certificate. A searchable verification page, where anyone types a number and sees whether it is genuine, is not part of core and needs custom development.

Site codes and the llms-user shortcode

{site_title} is what you would expect. {site_url} is not: it inserts the URL of your student dashboard page, not your home page. If you want your home page address on a certificate, type it as plain text.

For anything beyond the twelve codes, certificates also run shortcodes, and LifterLMS points the [llms-user] shortcode at the student who earned the certificate rather than the person viewing it. It prints any field stored on the user, with an optional fallback:

[llms-user first_name or="Student"]
[llms-user llms_billing_city]
[llms-user nickname or="Valued member"]

Any user meta key works, including custom fields you add to LifterLMS forms. The password field is blocked, and values that are not simple text, such as arrays, print the fallback instead. Like merge codes, shortcodes are resolved when the certificate is awarded or synced.

Add your own merge code

Two filters let a developer add a code: llms_certificate_available_merge_codes adds it to the editor's Merge Codes list, and llms_certificate_merge_data provides the value. The second filter receives the user ID, the template ID and the ID of the post that triggered the award, such as the completed course. The LifterLMS guide to custom merge codes uses the same two filters, and our article on fixing LifterLMS certificate problems includes a ready-made course title code.

This example adds a professional licence number stored in user meta, and prefixes sequential numbers with a code per template:

<?php
/**
 * Plugin Name: LLMSX Certificate Codes
 */

// 1. List the new code in the editor.
add_filter( 'llms_certificate_available_merge_codes', function ( $codes ) {
	$codes['{llmsx_licence}'] = __( 'Licence Number', 'llmsx' );
	return $codes;
} );

// 2. Supply its value when a certificate is merged.
add_filter( 'llms_certificate_merge_data', function ( $codes, $user_id, $template_id, $related_id ) {
	$licence                  = get_user_meta( $user_id, 'llmsx_licence_number', true );
	$codes['{llmsx_licence}'] = $licence ? $licence : __( 'Not provided', 'llmsx' );
	return $codes;
}, 10, 4 );

// 3. Turn 000042 into, for example, "CPD-000042".
add_filter( 'llms_certificate_sequential_id', function ( $id, $raw_id, $formatting, $certificate ) {
	$prefixes = array(
		123 => 'CPD',  // Certificate template ID => prefix.
		456 => 'ADV',
	);
	$template = (int) $certificate->get( 'parent' );
	return isset( $prefixes[ $template ] ) ? $prefixes[ $template ] . '-' . $id : $id;
}, 10, 4 );

Replace the template IDs with your own. To change the padding instead, for example four digits, filter llms_certificate_sequential_id_format and change its length value. After adding codes, sync existing certificates so they pick up the new values.

Common mistakes with merge codes

  • Typing codes by hand. {firstname} or { first_name } is printed literally. Use the Merge Codes button.
  • Using codes from other places. Notification templates use double-brace codes such as {{STUDENT_NAME}}, and engagement emails support their own smaller set. Neither works on certificates, and certificate codes like {sequential_id} do not work in emails.
  • Using {current_date} as the award date. It changes on every sync.
  • Expecting a course name code. Core has none. Type the course name into a per-course template or add a custom code.
  • Not syncing after changes. Template edits and new codes only reach existing certificates through a sync.
  • Testing with the preview only. The preview uses an administrator's profile, which usually has a full name. Award a test certificate to a student account without a first name to see the worst case.

Frequently asked questions

Can I put the course name on a LifterLMS certificate?

Not with a core merge code. Either create one template per course with the name typed in, or add a custom code that reads the course from the post that triggered the award.

Why does my certificate show the wrong date after I edited the template?

The template probably uses {current_date}, which is refreshed whenever a certificate is synced or updated. Switch to {earned_date} and sync again.

Can I reset the sequential ID to 1?

No. The Next Sequential ID field only accepts the current value or higher, so certificate numbers are never reused.

Do merge codes work in the certificate title?

The awarded certificate takes its title from the template's title. Put personal details in the certificate content, where merge codes are reliably replaced.

Next steps

Open each certificate template and check three things: names use a code that cannot come out blank, dates use {earned_date}, and numbering uses {sequential_id} if you issue numbered certificates. Then award a test certificate to a bare student account and sync your existing certificates if you changed anything.

If you need course or credit-hour codes, licence numbers, a public verification page, or PDF certificates generated automatically, our LifterLMS plugin development service builds those as small, update-safe plugins. Contact us with an example of the certificate you want to issue.

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