X

How to Remove <p> and <br /> from Contact Form 7

Snippets by IsItWP

Are you looking for a way to remove all of the extra <p> and <br /> from your forms? Contact form 7 is a great tool but sometimes it adds a little extra HTML that you might want to get rid off within your pages and posts. We have created a quick code snippet that you can use to remove <p> and <br /> from Contact Form 7.

Instructions:

All you have to do is add this code to your wp-config.php file:

define('WPCF7_AUTOP', false );

Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly add code snippets in WordPress, so you don’t accidentally break your site.

If you liked this code snippet, please consider checking out our other articles on the site like: 6 best Stripe payment plugins for WordPress and how to create a review site in WordPress.

Comments  Leave a Reply

  1. define(‘WPCF7_AUTOP’, false );

    This code should be placed inside the wp-config.php not functions.php

  2. Why It’s not working for me. ??
    And I’m using this code and It’s working fine.

    add_filter( ‘wpcf7_autop_or_not’, ‘__return_false’ );

  3. Thanhk you very much !

  4. Awesome, thanks!

  5. ????????? ???????? February 8, 2018 at 1:47 pm

    ??????? !

  6. Thanks

  7. Andrés Jorge Paz-Soldán Somoza September 18, 2017 at 6:54 pm

    Big thank you! That does the trick!

  8. Thanks a mill!

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!
[60% OFF Today!]
[60% OFF Today!]
[10% OFF Today!]
[10% OFF Today!]
[50% OFF Today!]
[50% OFF Today!]