LifterLMS Audio Lessons and Private Podcast Courses
How to add audio to LifterLMS lessons with the Audio Embed URL field or the Audio block, keep paid audio files private, and deliver a course as a…
Read articleLifterLMS 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.
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:
Everything else, such as a student changing their name next month, has no effect on certificates already awarded until you sync them.
| Merge code | Editor label | What it inserts |
|---|---|---|
{first_name} | Student First Name | The First Name field on the WordPress user profile |
{last_name} | Student Last Name | The Last Name field on the profile |
{student_name} | Student Display Name | The profile's display name, the "Display name publicly as" choice |
{email_address} | Student Email | The account email address |
{user_login} | Student Username | The WordPress username |
{student_id} | Student User ID | The numeric WordPress user ID |
{earned_date} | Earned Date | The date the certificate was awarded |
{current_date} | Current Date | The date the content was last merged |
{certificate_id} | Certificate ID | The awarded certificate's WordPress post ID |
{sequential_id} | Sequential Certificate ID | A per-template running number, padded to six digits |
{site_title} | Site Title | Your site's title from Settings > General |
{site_url} | Site URL | The URL of your student dashboard page |
The developer reference for llms_get_certificate_merge_codes() lists the same set.
{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:
{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.[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.
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.
{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_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.
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.
{firstname} or { first_name } is printed literally. Use the Merge Codes button.{{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.{current_date} as the award date. It changes on every sync.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.
The template probably uses {current_date}, which is refreshed whenever a certificate is synced or updated. Switch to {earned_date} and sync again.
No. The Next Sequential ID field only accepts the current value or higher, so certificate numbers are never reused.
The awarded certificate takes its title from the template's title. Put personal details in the certificate content, where merge codes are reliably replaced.
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.
How to add audio to LifterLMS lessons with the Audio Embed URL field or the Audio block, keep paid audio files private, and deliver a course as a…
Read article
Translate LifterLMS into your language and change wording such as "Mark Complete" or "My Courses" safely: language packs, the update-safe folder…
Read article
How LifterLMS behaves when you translate courses with WPML or Polylang: why each language is a separate course for enrollment and progress, which…
Read articleSkip the trial and error. Get specialist LifterLMS help and ship faster.