WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

closed as off-topic by birgire, kaiser Jul 28 '14 at 14:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

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.

share|improve this answer

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


share|improve this answer

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

share|improve this answer
I tried that fix yesterday and again today with no luck. – Carson Feb 2 '11 at 13:13
@carson tried using an older version of contact form ? – mireille raad Feb 2 '11 at 15:15

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.

share|improve this answer
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 '11 at 19:59

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 ;)

share|improve this answer
Modifying the core files directly is not a good practise. – Maruti Mohanty Dec 19 '13 at 19:13

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