contactform7 remove tags with “wpcf7_autop false” from functions.php

i want to remove those <p> and <br/> tags from my contactform7 forms. now they have this wpcf7_autop which can be set to false when inserting:

define('WPCF7_AUTOP', false);

to wp-config.php

The problem is:
I need this setting to be attached with my theme, so is it possible to some how do it through the functions.php file?

3 Answers
3

  • You can try minify html from the contact form 7

  • To completely disable the wpautop filter, you can use:

    remove_filter('the_content', 'wpautop');
    

Leave a Comment