WordPress.org

Ready to get started?Download WordPress

Forums

Contact form 7 how do I remove <br> tag? (16 posts)

  1. littlecuriosity
    Member
    Posted 4 years ago #

    Hi I've noticed contact form 7 has default
    tags.
    Does anyone know how I can remove these. I can't seem to find them in the settings?

    Thanks for all your help

    Regards
    Judi

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    CF7 doesn't have any default <br /> tags that I know of.

  3. rfearns
    Member
    Posted 4 years ago #

    Did you try your delete key?

  4. littlecuriosity
    Member
    Posted 4 years ago #

    he he solved my own problem
    http://www.aidanfindlater.com/2009/02/18/wordpress-plugin-contact-form-7-and-line-breaks/

    cheeky bugger 'Did you try your delete key?'

  5. esmi
    Forum Moderator
    Posted 4 years ago #

    You'd be surprised just how many times a blatantly obvious answer has eluded people. :-)

  6. Takayuki Miyoshi
    Member
    Posted 4 years ago #

    littlecuriosity, you don't have to change the plugin's code. Adding it to wp-config.php is better.

    Controlling Behavior by Setting Constants

  7. webbdiva
    Member
    Posted 4 years ago #

    I tried updating WPCF7_AUTOP to false in wp-contact-form-7.php with no luck. I even tried updating it through the wp-config.php file but I still got those darn <br /> tags.

    I sure wish the plugin would leave the use of both the <p> and <br> tags up to the user.

    if ( ! defined( 'WPCF7_AUTOP' ) )
    	define( 'WPCF7_AUTOP', false );

    Anyone have any suggestions?

  8. webbdiva
    Member
    Posted 4 years ago #

    In the end I was able to get the define( 'WPCF7_AUTOP', false ); to work correctly. I had it in the wrong place within the wp-config.php file. See Controlling Behavior by Setting Constants

    Cheers!
    Jules

  9. webbdiva
    Member
    Posted 4 years ago #

    Though I was able to get this working correctly in a v2.9 I am not able to get rid of the <br> tags in v3.0. I've added it to my wp-config file above the "Happy blogging" like the instructions say on Controlling Behavior by Setting Constants

    /* wp-contact-from-7 */
    define ('WPCF7_AUTOP', false );   // set to false to remove <br> tags
    
    /* That's all, stop editing! Happy blogging. */

    What am I missing?
    Jules

  10. poiseandapple
    Member
    Posted 3 years ago #

    When define ('WPCF7_AUTOP', false ); doesn't work, this will http://www.poiseandapple.com/panda-dev/getting-rid-of-br-tags-in-contact-form-7-plugin-for-wordpress-3-0-x/

    Read down to the second solution.

  11. jonrhoads
    Member
    Posted 3 years ago #

    None of the above solutions worked for me. Simple solution, update the your theme CSS file? :P

    I added the following: .wpcf7-form-control-wrap br { display: none; }

  12. cornhustlah
    Member
    Posted 3 years ago #

    BUMP.

    that link is dead, poiseandapple :/

  13. davidkuehne
    Member
    Posted 3 years ago #

    Wasn't working for me until I just included this in my wp-config file:

    define ('WPCF7_AUTOP', false );

    I also deactivated the plugin and reactivated it and voila! no more pesky paragraphs and breaks!

    Hope that works for you. I didn't include the if not defined portion: if ( ! defined( 'WPCF7_AUTOP' ) ), since it is already defined by wp-contact-form-7.php, I figured it would not set it again in the wp-config file. I'm just presuming this is why some can't redefine this to false but I haven't verified that this is the case.

    And you may not have to do the deactivate/reactivate part--but this is the process I went through, and now it's working for me. I'm using Version: 2.4.4

  14. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    http://voodoopress.com/2011/02/configuring-contact-form-7-to-work-perfectly-with-a-twentyten-child-theme/

    Not sure if any of this will be helpful, but its a collection of stuff I had to do to get CF7 working perfectly with WP3.1 and twentyten.....

  15. davidkuehne
    Member
    Posted 3 years ago #

    Thanks Rev. Very helpful. I just included some of those in my functions file and CSS.

  16. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    Awesome, glad some of it was helpful for you!

Topic Closed

This topic has been closed to new replies.

About this Topic