• Skip to content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer

Wordpress Expert

Your personal Wordpress Coach

Header Right

  • Facebook
  • Linkedin
  • RSS
  • Twitter
  • Xing
  • Plugins
  • Themes
  • Howtos
  • WordPress News
  • Blog
You are here: Home / Plugins / Remove line breaks & paragraphs from Contact Form 7

Remove line breaks & paragraphs from Contact Form 7

26. April 2017 by Mat Boehmichen

An ordinary form built with Contact Form 7
An ordinary form built with Contact Form 7

Anyone who builds and maintains WordPress websites probably knows the “Contact Form 7” plugin. With Contact Form7, you can quickly and easily create a decent form as WordPress blogger or website operator, which also looks pretty nice.

With the “Contact form 7 – Success Page Redirects” plug-in extension, you can even redirect the website visitor to a special thank-you page after completing the form. This helps in conversion tracking. So far, so good.

Contact Form 7 has an unsightly error which I find pretty annoying: In the normal representation, the lines and fields are really far apart. This results in more horizontal space needed.

And even worse: if the form has a lot of fields underneath, the screen button slips below the screen edge – below the fold – and therefore won’t be visible to the visitor. Another valuable contact will be lost. Too bad.

The reason for the lengthy form can be found pretty fast (using dev tools in chrome for example): In Contact Form 7, a </ br> or </ p> is inserted after each form field. An extra blank line – just for nothing

HTML Form coide
HTML Form coide

This may be ok for common settings – but I still want to get rid of the extra </br> and </p> in the Contactform 7 plugin. How can this be achieved?

The solution is quite simple – apparently the plugin developer already had the problem himself: With the setting “define (, WPCF7_AUTOP ‘, false);” in your wp-config.php file this can be fixed for all forms on the affected WordPress website. This little trick removes all paragraphs and line breaks in Contact Form 7.

More about:
LavaLamp for jQuery lovers!
Contact Form with less space between the form fields
Contact Form with less space between the form fields

To add this to your WordPress site:

  • Open your wp-config.php file. It is in the top directory of your WordPress installation
  • Search for the entry ‘WP_DEBUG’ or ‘WPLANG’
  • Insert a new line just after one of these lines
  • Insert the following and save the wp-config.php file

define ('WPCF7_AUTOP', false );

 

Then reload your WordPress Website and check your form again: The form fields are much closer together, compared to before. If you like, you can also customize individual CSS elements, until the appearance fits your design ideas or corporate identity.

 

  • About the Author
  • Latest Posts

About Mat Boehmichen

Mat is the founder of several businesses including Awantego.com - a digital Content agency. He is a wordpress maniac since 2008 and loves to test awesome worpress themes and new plugins. He loves to write technical howtos and tutorials as long as there is a bit of information technology inside.

  • Themes on Themeforest – best new Themes June 2017 - 7. July 2017
  • Remove line breaks & paragraphs from Contact Form 7 - 26. April 2017
  • New Themes & Plugins for WordPress - 25. April 2017
  • Envato: Latest Themes for WordPress (Week 15 / 2017) - 18. April 2017
  • Speed Up WordPress - 17. April 2017
View All Posts

Related posts:

No related posts.

Filed Under: Plugins, Wordpress Tagged With: Contact Form 7, Plugin, Quick Hack

About Mat Boehmichen

Mat is the founder of several businesses including Awantego.com - a digital Content agency. He is a wordpress maniac since 2008 and loves to test awesome worpress themes and new plugins. He loves to write technical howtos and tutorials as long as there is a bit of information technology inside.

Reader Interactions

Primary Sidebar

Search this Site:

Latest posts on Wordpress …

Themes on Themeforest – best new Themes June 2017

Themes on Themeforest – best new Themes June 2017

7. July 2017 By Mat Boehmichen

There are quite a lot of new WordPress themes that were published in June 2017 on Themeforest. We’ll show you the 5 best selling new themes from June 2017 Jannah – WordPress News Magazine Blog & BuddyPress Theme by TieLabs Jannah takes a fresh look at the world of desktop publishing in today’s modern age […]

New Themes & Plugins for WordPress

New Themes & Plugins for WordPress

25. April 2017 By Mat Boehmichen

It is absolutely amazing how many new themes appear on Themeforest each and every day! Check out these new themes that appeared first on themeforest.net: Ekko – Business MultiPurpose WordPress Theme by HighGrade | ThemeForest Ekko – Business MultiPurpose WordPress Theme by HighGrade | ThemeForest Ekko is a reliable and responsive WordPress multiconcept, multipurpose business […]

WordPress 4.7.4 to be released on April 20th 2017

WordPress 4.7.4 to be released on April 20th 2017

19. April 2017 By Katharina Berger

As WordPress developer Pascal Birchler announced yesterday, the next minor release of WordPress will be released to the users on April 20th, 2017. 4.7.4 Release Candidate – Make WordPress Core 4.7.4 Release Candidate – Make WordPress Core After about six weeks of development, a Release Candidate for WordPress 4.7.4 is now available. This maintenance release fixes 46 […]

Envato: Latest Themes for WordPress (Week 15 / 2017)

Envato: Latest Themes for WordPress (Week 15 / 2017)

18. April 2017 By Mat Boehmichen

I always love to scroll through the newly published wordpress themes on themeforest. Although most of the themes will not be tomorrow’s superstars, it’s always fun to see the concepts and design ideas the developer comes up with. Here are my – totally arbitrary – picks from the newly released themes and template for wordpress: […]

Follow me - wherever you are

RSSTwitterFacebookLinkedin

More on Wordpress

A Roundup of 15 Mobile Web Design Tutorials

6. January 2013 By Patrick Chang

Print a Part of Page using Javascript

11. October 2012 By Patrick Chang

BBC Radio 1 Zoom Tabs

17. April 2012 By Patrick Chang

Coda Slider Effect

2. April 2012 By Patrick Chang

Display Apache Server Status with mod_status

4. January 2012 By Patrick Chang

Make browser image upload appear in a meta box?

6. December 2011 By Patrick Chang

Use WordPress Cron

17. November 2011 By Patrick Chang

Footer

Recent Posts:

  • Themes on Themeforest – best new Themes June 2017 7. July 2017
  • Remove line breaks & paragraphs from Contact Form 7 26. April 2017
  • New Themes & Plugins for WordPress 25. April 2017
  • WordPress 4.7.4 to be released on April 20th 2017 19. April 2017
  • Envato: Latest Themes for WordPress (Week 15 / 2017) 18. April 2017

Articles:

  • Allgemein (1)
  • Development (2)
  • Howto (24)
  • Plugins (12)
  • Review (1)
  • Social Media (5)
  • Themes (9)
  • Tutorial (2)
  • Wordpress (7)
  • Wordpress News (2)

About me:

Hi, I'm Mat and I love to write about Wordpress. On Wordpress-Expert.info you'll find a lot of Tutorials, Howtos and Guides on Wordpress.
If you want to know more about me ... read on.

© 2018 · Awantego.com ·