How to Hide Image Choices in Notification Emails

Overview

Would you like to hide Image Choices in your notification emails from WPForms? If you want to show image choices on your forms but don’t necessarily need them in your email, you can easily use a small PHP code snippet to disable these. We’ll show you how to disable the Image Choices from your notification emails.

When using image choices in WPForms, the image for any user-selected option(s) will be included in the notification email by default.

Providing you don’t need to see these images in your notifications, performing this step could potentially save you precious time and valuable space when sending and receiving your form notifications.

Implementation Options

The three snippets shown below each apply to a different field type: Multiple Choice, Checkboxes, and Multiple Items fields.

As an example, this is how a form would look with images set up for the Checkboxes.

An example form using image choices for the checkboxes

To hide the Image Choices for all of these form fields, you’ll need to copy all three snippets into your site.

Or you can break it down individually based on the form fields you’re using.

Multiple Choice

/**
 * Multiple Choice - hide images on notification emails
 *
 * @link https://wpforms.com/developers/how-to-hide-image-choices-in-notification-emails/
 *
 */
function wpf_dev_radio_field_html_value_images() {
 
    return true;
}
add_action( 'wpforms_radio_field_html_value_images', 'wpf_dev_radio_field_html_value_images', 10, 2 );

Checkboxes

/*
 * Checkboxes - hide images on notification emails
 *
 * @link https://wpforms.com/developers/how-to-hide-image-choices-in-notification-emails/
 *
 */
function wpf_dev_checkbox_field_html_value_images() {
 
    return true;
}
add_action( 'wpforms_checkbox_field_html_value_images', 'wpf_dev_checkbox_field_html_value_images', 10, 2 );

Multiple Items

/*
 * Multiple Items - hide images on notification emails
 *
 * @link https://wpforms.com/developers/how-to-hide-image-choices-in-notification-emails/
 *
 */
function wpf_dev_payment-multiple_field_html_value_images() {
 
    return true;
}
add_action( 'wpforms_payment-multiple_field_html_value_images', 'wpf_dev_payment-multiple_field_html_value_images', 10, 2 );

By removing the image choices from the notification emails you can reduce the size of the email as it’s being sent.

Email notification showing only the label and not the image choices

And that’s all you need to disable these images in your notifications. Would you like to change or remove the text shown at the bottom of these email notifications? If so, take a look at our How to Remove or Change Email Notification Footer Text.