Adding Quiz Custom Form Fields to a LearnDash Certificate
Ask learners for an employee number or registered name inside a LearnDash quiz, then print it on the certificate. How Custom Fields are stored, why Statistics must be on, and the [quizinfo] syntax.

A certificate sometimes needs information that only the learner can supply at the moment of assessment: the exact name they want printed, an employee or membership number, a declaration that they completed the work unaided. LearnDash 4.18.0.1 quizzes have a Custom Fields feature for exactly this. The learner fills in a short form before or after the quiz, the answers are stored with the attempt, and the [quizinfo] shortcode can print each answer on a quiz certificate. This guide covers the settings, the one dependency that catches most people out, and the shortcode syntax, all verified against the plugin source.
What Custom Fields are
In a quiz's settings, under Administrative and Data Handling, the Custom Fields switch adds a small form builder. Each field has a name, a type and a required flag. The types, from the quiz form model, are Text, Textarea, Number, Checkbox, Email, Yes/No, Date, Select and Radio; Select and Radio take their options from the field's data box, one per line. A Display Position setting places the form before the quiz starts or after it finishes, immediately before the results. Fields are stored in the pro quiz form table, and each row has a numeric ID, shown in the first column of the Custom Fields table in the quiz settings; you will need that ID for the shortcode.
The dependency: Quiz Statistics
The learner's answers are not stored with the quiz attempt in user meta. They are saved as form data on the attempt's statistics reference, which only exists when Statistics are enabled for the quiz. In the source, the statistics controller aborts saving when the quiz's statistics flag is off, and the [quizinfo] field branch reads form data from the statistic reference identified by the attempt's statistic_ref_id. So the sequence is:
- In the quiz settings, under Administrative and Data Handling, turn on Statistics.
- Turn on Custom Fields, add your fields and note each field's ID.
- Choose the Display Position.
- Save the quiz, then take it once as a test learner so that an attempt with form data exists.
Attempts made before Statistics were enabled have no form data and will print blank, which is the usual reason a field shows nothing on an older learner's certificate.
Printing a field on the certificate
Attach a certificate to the quiz in its settings, then use the shortcode in the certificate content:
Registered name: [quizinfo show="field" field_id="3"]
Employee number: [quizinfo show="field" field_id="4"]
Declaration: [quizinfo show="field" field_id="5"]
On a quiz certificate, [quizinfo] takes the quiz and user from the certificate URL, so quiz and user_id attributes are not needed. The shortcode selects the attempt whose timestamp matches the time argument in the certificate link, falling back to the last attempt for that quiz, and then looks up the form element whose ID matches field_id. The value is formatted by type: text, textarea, email, number, radio and select answers are escaped and printed as entered; a checkbox prints "ticked" or "not ticked"; Yes/No prints "Yes" or "No"; a date field is formatted with the shortcode's format attribute, which defaults to F j, Y, g:i a, so pass format="F j, Y" for a date without a time.
Using the registered name instead of the profile name
The most common use is a name field, because the WordPress display name is often a username or a nickname. Replace the usual [usermeta field="display_name"] with the field shortcode, and make the field required so that no learner reaches the certificate without one. For accredited certificates it is worth adding a note on the form that the name will be printed exactly as typed. If you also want the name available outside certificates, for example in reports, copy it to user meta when the quiz completes with a hook on learndash_quiz_completed; the Custom Field answers themselves are only accessible through the statistics data.
Where the answers can be seen
Administrators and group leaders see the form answers in the quiz statistics view for the attempt, reached from the user's profile or the quiz's statistics screen; the Custom Fields section appears at the top of each attempt's statistics. That is the place to check what the learner typed if a certificate prints something unexpected. Answers are not included in the standard quiz export, so sites that need them in a spreadsheet usually read the statistics tables directly or build a small report.
Limits to plan around
- Quiz certificates only. Course certificates render with a course context, not a quiz attempt, so
[quizinfo show="field"]on a course certificate needs an explicitquizattribute and prints the learner's last attempt of that quiz. That works when the course contains one final quiz. - Retakes. Each attempt stores its own answers. The certificate link from the results page carries the attempt timestamp, so it prints that attempt's answers; a link from the profile prints the attempt it refers to.
- Editing answers. There is no admin interface for correcting a typed value. The learner retakes the quiz or an administrator edits the statistics form data in the database.
- Field IDs are per quiz. A certificate shared by several quizzes cannot use one
field_idfor all of them unless the IDs happen to match. Use one certificate per quiz, or keep the field in a single final quiz.
Testing checklist
Take the quiz as a learner, fill the form, pass, and open the certificate from the results page. Then open it again from the profile. Finally, open it as an administrator from the learner's profile to confirm the field prints when someone else views the certificate; the [quizinfo] shortcode reads the user argument for administrators and group leaders on certificate pages, so it should. The certificate shortcode reference covers the other show values you can combine with the field, and showing the date, score and time spent covers the attempt data most certificates print next to it.
When to get help
Exporting Custom Field answers, validating a typed number against a membership database before the certificate is issued, or pre-filling the form from the user's profile are small development tasks. They are the kind of work our LearnDash services team does alongside certificate design, and a LearnDash developer can add validation to the form in an afternoon.
Frequently asked questions
Why does [quizinfo show="field"] print nothing?
Either Statistics were off when the attempt was made, so no form data was stored, or the field_id does not match the ID shown in the Custom Fields table. Retake the quiz with Statistics on and check the ID.
Can I show the custom field on a course certificate?
Yes, with an explicit quiz attribute pointing at the quiz that collected it. The shortcode then prints the learner's most recent attempt of that quiz.
Where do I find the field ID?
In the quiz settings, the Custom Fields table lists each field with its numeric ID in the first column after the drag handle. New fields get an ID once the quiz is saved.
Do the answers appear in the Certificate Builder?
Yes. The builder runs [quizinfo] inside paragraphs and headings, and its Quiz Info block exposes the same show values.
Add worldwincoder.com as a preferred source on Google, or open this article in your AI assistant to use it as a source.
