Contact Form 7 from adding paragraph and break tags to HTML emails [closed]

I’m trying to stop Contact From 7 from adding paragraph and break tags to HTML emails but can’t figure it out. About 4 blank paragraph tags are added at the beginning of the email and two at the end.

This question brings up the same issue, and the fix is said to have come in a recent update but I have the most recent one and no luck.

Any ideas?

5 Answers
5

well if you updated and it didn’t work, try doing the fix manually

as per this user

“The solution I came up with was a serious hack, but there was no other way around it short of editing the plugin’s core code. Just stick this somewhere in your theme’s functions.php and it should work:”

    add_filter("wpcf7_mail_tag_replaced", "suppress_wpcf7_filter");
function suppress_wpcf7_filter($value, $sub = ""){
    $out    =   !empty($sub) ? $sub : $value;
    $out    =   strip_tags($out);
    $out    =   wptexturize($out);
    return $out;
}

hope it helps – otherwise if you are really helpless u might have to roll back to an older version of contact form. Version 2.2.1 doesn’t seem to have this problem while version 2.3 has it

Leave a Comment