Hello @orangr-ghost,
Could you please try replacing the previous snippet with this one:
<?php
$form_id = 2960;
add_filter( 'forminator_custom_form_mail_admin_message', 'wpmudev_remove_labels_from_mail', 10, 5 );
function wpmudev_remove_labels_from_mail( $message, $custom_form, $data, $entry, $cls_mail ) {
global $form_id;
if ( $form_id !== intval( $custom_form->id ) ) { // Please change the form ID.
return $message;
}
$message = preg_replace("/<b>(.+?)<\/b>/is", '', $message);
return $message;
}
add_filter( 'forminator_custom_form_mail_admin_message', 'wpmudev_remove_html_field_content_from_mail', 10, 5 );
function wpmudev_remove_html_field_content_from_mail( $message, $custom_form, $data, $entry, $cls ) {
global $form_id;
if ( $form_id !== intval( $custom_form->id ) ) { // Please change the form ID.
return $message;
}
$html_data = array();
$fields = $custom_form->get_fields();
foreach ( $fields as $field ) {
if ( false !== strpos( $field->slug, 'html-' ) ) {
$html_data[] = forminator_get_field_from_form_entry( $field->slug, $custom_form, $entry, false );
}
}
foreach ( $html_data as $html_key => $html_val ) {
if ( $html_val !== '' ) {
$replace_val = $html_val;
$message = str_replace( $replace_val, '', $message );
}
}
return $message;
}
– replace 2960 with your form ID on this line:
$form_id = 2960;
I hope this helps. Please let us know if you need any further assistance!
Best Regards,
Dmytro