PDF Invoices
Paid Memberships Pro PDF Invoices prints extra values with a placeholder. User Fields do not need code. The filter below is still valid for user meta that is not a User Field, and for data that is not stored on the user.
User Fields
For a Paid Memberships Pro User Field, copy the Name column and use {{field_name}}. Do not use the label. Steps and screenshots are in Adding User Fields to PDF Invoices.
Which path to use
| Source | Placeholder | Code |
|---|---|---|
| User Fields | {{birthday}} | No. Use the Name column. |
| Other user meta | {{legacy_member_id}} | Still valid. Use the filter to format or rename it. A matching {{meta_key}} is also filled automatically. |
| Order notes, order meta, or a custom table | {{notes}} | Yes. Register it with the filter. |
Add a placeholder with code
Add this to a custom plugin or a must-use plugin. The first argument is the placeholder list. Return that array or the new value is dropped.
<?php
/**
* Add custom placeholders to Paid Memberships Pro PDF Invoices.
*
* Still valid for user meta that is not a User Field, and for order data.
*/
function my_pmpro_pdf_example( $data_array, $user, $order_data ) {
// User meta that is not a User Field.
$data_array['{{legacy_member_id}}'] = esc_html( get_user_meta( $order_data->user_id, 'legacy_member_id', true ) );
// Order data that is not stored on the user.
$data_array['{{notes}}'] = esc_html( $order_data->notes );
return $data_array;
}
add_filter( 'pmpro_pdf_invoice_custom_variables', 'my_pmpro_pdf_example', 10, 3 );
In the template, {{legacy_member_id}} prints that user meta value. {{notes}} prints the order notes. A missing key, or an empty value, prints blank.
Filter arguments
| Argument | What it is |
|---|---|
$data_array | Placeholder keys and values. Include the braces in the key, for example {{notes}}. |
$user | The member, or false if that user no longer exists. For user meta, use $order_data->user_id. |
$order_data | The Paid Memberships Pro order. Use this for notes, totals, and other order values. |
Add it to the template
- Go to Settings → PMPro PDF Invoices.
- Open the Tools tab.
- Click Create Template, or Edit Template if a custom template already exists.
- Place the placeholder where the value should print, then save.

Saving the template does not rewrite PDFs already stored. Download a sample, then generate or regenerate invoices from the Tools tab. Button details are in Create, edit, and select a template.
Common mistakes
Using this filter for a User Field
User Fields already print from the Name column. The filter is for other values.
Fix: Use {{birthday}} for a User Field named birthday. Keep the filter for user meta that is not a User Field, or for order data.
Forgetting to return the array
The filter replaces the placeholder list with whatever you return. No return means the new token is dropped.
Fix: End the callback with return $data_array;.
The template token does not match the array key
The key must include both pairs of braces, and it must match the template exactly.
Fix: Set $data_array['{{notes}}'] and put {{notes}} in the template. No spaces.
Reusing a built-in placeholder name
Names such as first_name, invoice_code, and billing_city are already filled by the plugin.
Fix: Use your own token, such as {{legacy_member_id}}.