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

  • I tried that fix yesterday and again today with no luck.
    – Carson
    Feb 2, 2011 at 13:13
  • @carson tried using an older version of contact form ? Feb 2, 2011 at 15:15

I came to the conclusion that new lines (enter's) in the textarea are being converted to html line breaks (br's).

So if I put the input on the same line as the label, it shows correctly.

Hope it helps.


I agree with David Garcia, in the textarea where you compile your form, any new line is converted to a

the paragraphs instead are automatically created by CF7 in rendering the forms. You've just to reset css to p tags inside the form.

  • Nope, I had a css reset. Extra blank paragraph tags were being added somewhere out of my control. I ended up making my own form and sending it hah.
    – Carson
    May 3, 2011 at 19:59

This seems to be a bug with the contact form plugin. You may look at the plugin source files to see if there are extra <p> tags.


Open the "classes.php" file in the CF7 plugin's "includes" folder and uncomment the following line (number 550) like so ...

//$body = wpautop( $body );

Hope this helps (you too)!

TIP: Minify your HTML-Email-Content with a HTML-Minifier - just to be safe ;)

  • 2
    Modifying the core files directly is not a good practise. Dec 19, 2013 at 19:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.