How to Show Empty Form Fields in Email Notifications

Overview

Would you like to show empty form fields inside your email notifications? By default, WPForms doesn’t include any empty fields in the email notifications, but this can be easily changed with a small code snippet added to your site. We’ll show you how to use PHP to include all form fields inside your email notifications.

Setup

To begin, you’ll need to add this snippet to your site. If you need any assistance in how to add snippets to your site, please review this tutorial.

/**
 * Show empty form fields in email notifications.
 *
 * @link https://wpforms.com/developers/how-to-show-empty-form-fields-in-email-notifications/
 */

add_filter( 'wpforms_email_display_empty_fields', '__return_true' );

Once the code has been added, you’ll now see all form fields inside your email notifications, including the empty ones.

With the PHP snippet, you'll now show empty form fields in your email notifications

And that’s it! You’ve now completed the steps needed to include all form fields in your email notifications. Would you like to hide the image choices in your email notifications as well? Take a look at our tutorial on How to Hide Image Choices in Notification Emails.

Filter Reference: wpforms_email_display_empty_fields