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.
This is working fine for me for the frontend of the site but not working for the contact form submission emails.
Can someone please help me with this?
Thank you
That solved my problem with extra in Contact Form 7 perfectly.
Thanks! This worked perfectly!
Thanks, it fix the forms after I update the plugin that break the form I build
thanks
define(‘WPCF7_AUTOP’, false );
This code should be placed inside the wp-config.php not functions.php
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’ );
Thanhk you very much !
Awesome, thanks!
??????? !
Thanks
Big thank you! That does the trick!
Thanks a mill!