Home > Docs > WooCommerce PDF Invoices, Packing Slips and Credit Notes Plugin > Adding Custom Placeholders to WooCommerce Invoices, Packing Slips and Credit Notes

Adding Custom Placeholders to WooCommerce Invoices, Packing Slips and Credit Notes

Last updated on April 1, 2025

The introduction of custom placeholders on WooCommerce invoices, packing slips and credit notes proves to be essential for business communication, branding, and operational efficiency. The default templates may not always include all necessary information relevant to your business or customers, such as custom messages, additional order details, or special handling instructions. With WebToffee’s WooCommerce PDF Invoices, Packing Slips, and Credit Notes plugin, store owners can dynamically insert personalized data into invoices, packing slips and credit notes enhancing clarity, professionalism, and customer experience.

Here are the brief steps in adding custom placeholders:

  1. Add the custom code snippet to your WordPress site.
  2. Insert the custom placeholder in the template.
  3. Save Settings.

Prerequisites

  1. Install and activate the free WooCommerce PDF Invoices, Packing Slips, Delivery Notes, and Shipping Labels plugin.
  2. Install and activate the pro add-on WooCommerce PDF Invoices, Packing Slips, and Credit Notes.

Step 1: Add the custom code snippet

The first step is to add the custom code snippet to your WordPress site.

Before adding the code, ensure you update the custom code snippet by replacing ‘_metakey1’ and ‘_metakey2’ with the appropriate meta keys for the data you want to display on the document.

You can add the snippet to the active child theme’s functions.php file or use a third-party plugin. To learn more about adding a custom code snippet using a third-party plugin, refer to this article: Adding Custom Codes Using Third-Party Plugins.

Note: To add custom placeholders to packing slips, credit notes and delivery notes, update ($template_type==’invoice’) in the code to ($template_type==’packinglist’) for packing slips or ('creditnote' === $template_type) for credit notes or ($template_type==’deliverynote’) for delivery notes.

Step 2: Add the custom placeholders to the template

After adding the custom code snippet, next step is to insert the custom placeholder in the document template.

  1. First, copy the two placeholders [wfte_custommeta1] and [wfte_custommeta2] from the custom code snippet.
  2. Navigate to Invoice/Packing > Invoice (Packing slip or credit note) > Customize from the WordPress dashboard.
  3. Scroll down and click on the Code editor.
Code editor - WooCommerce invoice, packing slip and credit note
Code editor – WooCommerce invoice, packing slip and credit note
  1. Paste the placeholders into the template code editor. Their placement within the editor will determine their position in the final document.

Step 3: Save Settings

  1. Click on Update Template to save the changes.

Example

Let’s take an example where we add two custom meta fields – Shipping City and Order Currency—to WooCommerce invoices, packing slips, and credit notes. In the custom code, the meta keys _metakey1 and _metakey2 will be replaced with _shipping_city and _order_currency, respectively. These placeholders will then be inserted into the code editor of invoices, packing slips, and credit notes. The placeholders are positioned right below the “From Address” placeholder in the document. The meta fields will appear in WooCommerce invoices, packing slips and credit notes as shown below: