Charitable Documentation

Learn how to make the most of Charitable with clear, step-by-step instructions.

Adding Custom Fields to PDF Receipts

Would you like a custom field from your donation form to show up on the PDF receipt? When you add a custom field to a legacy form or build one in the campaign visual builder, Charitable saves the donor’s answer with the donation – but the PDF receipt template doesn’t print it automatically. You’ll need to tell the receipt where the value lives and how to display it.

This guide will walk you through the steps to add a custom donation field to your PDF receipt, whether the field came from a legacy form or the visual form builder.

Note: This section assumes you are using Charitable Pro 1.8.13+ and involves a small amount of PHP. If you’re not comfortable editing code, paste the snippet into a tool like WPCode so you don’t have to touch theme files directly, or hand it to your developer.

How Are Custom Fields Stored?

Before you can show a field on the receipt, you need two things: where its value is stored, and what key to look it up by. Charitable saves both legacy form and visual form custom fields as donation post meta, but the meta key looks different depending on which form created it.

For legacy form custom fields, the meta key is whatever was registered with the field. If you registered a field with the key t_shirt_size using the Donation Fields API, the value is stored under that exact key.

For visual form custom fields, the key uses the format field_X, where X is the numeric ID the campaign builder assigned to the field. Hidden fields are the exception – those use whatever name you typed into the Field Name setting.

Finding the Meta Key for Your Field

The easiest way to confirm which meta key a field uses is to look at a real donation that included the field.

For a legacy form, the meta key is the array key you used when registering the field with the charitable_default_donation_fields filter. If you didn’t write the snippet yourself, you can search your site (or ask your developer) for that filter to confirm the key.

For a visual form, go to Charitable » Donations, open a test donation that submitted the custom field, and look through the donation’s saved data for entries like field_3 or field_5. The number is the field’s builder ID. If you’d rather see every meta key in one shot, you can drop this temporary snippet onto any admin page:

echo '<pre>';
print_r( get_post_meta( 123 ) ); // Replace 123 with your test donation ID.
echo '</pre>';

Note: Once you’ve copied down the keys you need, remove the snippet – leaving print_r() calls in production output is messy and can leak donor data.

Adding a Field Using a Hook (Recommended)

Charitable fires an action called charitable_pdf_receipt_after_donor_details right after the donor details block on every PDF receipt. Hooking into this action is the simplest way to add a custom field, because you don’t have to override any template files – your changes survive plugin updates with no extra work.

To activate the snippet, paste it into your child theme’s functions.php file or into a code snippets plugin:

add_action( 'charitable_pdf_receipt_after_donor_details', function( $donor, $donation ) {

    // Replace 't_shirt_size' with your field's meta key.
    // For a visual form custom field, this will look like 'field_3'.
    $value = get_post_meta( $donation->ID, 't_shirt_size', true );

    if ( empty( $value ) ) {
        return;
    }

    printf(
        '<p style="margin-top: 10px; margin-bottom: 0;"><strong>%s:</strong> %s</p>',
        esc_html__( 'T-Shirt Size', 'charitable-pro' ),
        esc_html( $value )
    );

}, 10, 2 );

The example prints the field underneath the donor’s name, address, and email. When adapting it, swap the meta key, the visible label, and the markup to match the field you’re adding.

Note: If your value contains HTML – for example, output from a long-text field – use wp_kses_post() instead of esc_html() so basic formatting tags survive.

Adding a Field by Overriding the Template

If you need to place the field somewhere other than after the donor details – for example, inside the donations table or in the footer – you can override the PDF receipt template.

Charitable’s PDF templates are theme-overridable. To customize the main PDF layout, copy this file:

wp-content/plugins/charitable-pro/templates/pro/pdf-receipts/pdf.php

Into your active theme at this path:

wp-content/themes/your-theme/charitable-pro/pro/pdf-receipts/pdf.php

Once your copy is in place, Charitable will load it instead of the plugin’s version. The same path pattern works for the two partial templates that pdf.php calls:

  • Donor details: templates/pro/pdf-receipts/donation-receipt/donor-details.php
  • Donation details: templates/pro/pdf-receipts/donation-receipt/details.php

Inside any copied template, the $donation variable is the full Charitable_Donation object. To pull a custom field’s value, use the same get_post_meta() call from the previous method, then add markup wherever you want the value to appear:

<?php
$value = get_post_meta( $donation->ID, 'field_3', true );
if ( ! empty( $value ) ) :
    ?>
    <p><strong><?php esc_html_e( 'Gift Aid Eligible', 'charitable-pro' ); ?>:</strong> <?php echo esc_html( $value ); ?></p>
    <?php
endif;
?>

Note: Template overrides need to be reviewed every time you update Charitable Pro. If the plugin’s version of the template picks up new features or bug fixes, your override won’t see them automatically. The hook method above avoids this entirely, so use a template override only when you need control over placement.

Previewing Your Changes

Once your snippet or template override is saved, generate a real PDF to confirm the field appears as expected. From the Charitable » Donations screen, pick a donation that included the custom field, then click the PDF icon next to it to download the receipt. If the field doesn’t appear, work through these checks one at a time:

  • Confirm the meta key matches exactly – field_3 and field_03 are not the same.
  • Verify the donation you’re testing actually submitted a value for the field. Empty values won’t print.
  • Try a different test donation to rule out one entry being empty.

Note: Field values that look empty on the donation admin screen will also be empty on the PDF. The receipt cannot show data the donation never collected.

Still have questions? We’re here to help!

Last Modified:

What's New In Charitable

View The Latest Updates
🔔 Subscribe to get our latest updates
📧 Subscribe to Emails

Email Subscription

Join our Newsletter

We won’t spam you. We only send an email when we think it will genuinely help you. Unsubscribe at any time!

Integration page builder

Divi Fans Rejoice! Native Divi 5 Campaign Progress Bar Module!

With our new native Divi 5 module, you can anchor your microsites with real-time fundraising stats directly on the visual canvas. Here’s how it works, and why it’s worth turning on today.

Create campaign updates that are VISUAL AND LIVE. You can also:

📊 Campaign Progress Bar: Drop a live progress bar into any Divi 5 layout and show goal progress in real time.

🎨 Deep styling controls: Easily customize the bar and track color, height, and radius to match your brand perfectly.

👁️ Visual Builder ready: Configure and preview everything directly on the Divi canvas as a first-class module.

🔁 Identical rendering: The same exact engine powers this module, meaning consistent design without legacy shims.

✅ Faster launches: Never leave the Divi 5 interface to configure shortcodes or guess how your goal labels will look.

Learn more here.

Integration page builder

👉🏻 New in Charitable: Native Elementor Widgets for Seamless Campaign Building

With native Elementor widgets, you design donation campaigns right alongside the rest of your page without touching code. Here’s how it works, and why it’s worth turning on today.

Create fundraising pages that are VISUAL, NATIVE, AND SHORTCODE-FREE. You can also:

⚡ Mini Donation: Add a compact, high-converting donation widget with preset amounts and full color control.

⏳ Campaign Countdown: Build urgency for a deadline-driven appeal, complete with optional confetti when the goal is hit.

📣 Donation Feed: Prove momentum by showing visitors the social proof of real people giving right now.

🏆 Donor Leaderboard: Celebrate top supporters with gold, silver, and bronze styling to spark friendly giving.

🖼️ Campaign Showcase: Feature multiple campaigns in a landing page grid or carousel, with search, filters, and badges.

Learn more here.

Addon New

🗒️ Custom Receipts… New Addon!

With Custom Receipts, you decide which page your donors see, on every campaign. Here’s how it works, and why it’s worth turning on today.

Left side shows a donation receipt with donation number, date, total, and payment method for a  gift to Anywhere, titled 'One Family Gets Clean Water For A Week.'

Create receipts that are CUSTOM TO THE DONOR OR CAMPAIGN. You can also:

📅 Year-end appeal: Reinforce the goal and invite donors to share while momentum is high.

🎗️ Memorial or tribute campaign: Give a gentle, respectful thank-you that fits the moment.

💎 Major gifts: Show a special message only to donors who give above a threshold.

🔁 Recurring growth: Invite one-time donors to become monthly supporters right on the receipt.

🌍 Global campaigns: Surface a country-specific note, like a Gift Aid reminder, only where it applies.

Learn more here.

New templates

🤩 New Beacon Campaign Templates w/ “Hero” Block!

With the new Beacon Campaign Templates for Charitable Pro, you can launch a stunning, full-width fundraising page that instantly captures visitor attention above the fold.

Fundraising page header for Save Maple Grove Park with a donation widget and a small square photo of a sunlit tree thumbnail on the left.

🔦 Above-the-Fold Impact: Lead with a full-width hero image, your logo, and your goal with a donation widget locked right on top of the banner so your ask and momentum register instantly without scrolling.

📐 Two Flexible Layouts: Choose between a structured two-column layout for side-by-side storytelling and supporting details, or a clean one-column view designed for uninterrupted long-form narratives.

⚡ All-in-One Hero Field: Powered by the new Campaign Hero field, bringing background media, live progress bars, custom donation amounts, and recurring giving tabs together into a single cohesive block that can be dropped into any layout.

🎨 Automatic Theme Matching: The hero banner and donation widget automatically inherit your campaign theme’s button and accent colors, ensuring your entire presentation stays beautifully on-brand without touching a line of CSS.

Learn more here.

donation form Feature New

📝 Donation Form Block: Embed a Working Donation Form Anywhere

With the new Donation Form Block for Charitable Pro, you can drop a fully working donation form directly onto any page or post in the WordPress block editor. No redirects, no page reloads, and zero friction between reading your story and making a contribution.

📝 Drop Forms Anywhere: Place a working form directly onto your homepage, inside a story-driven blog post, on a dedicated landing page, or within a campaign announcement.

🎯 Dynamic Campaign Binding: Easily choose a specific campaign from the block sidebar or set it to automatically bind to whichever campaign is currently being viewed.

📐 Full vs. Minimal Form Views: Switch between a full layout or a compact minimal view to perfectly fit sidebars, narrow columns, or wide landing pages.

🎨 Scoped No-Code Styling: Customize typography, container spacing, border radius, amount buttons, and accent colors independently for every form instance without touching a line of CSS.

Learn more here.