Summary: Contact Form 7, a Wordpress plugin, automagically adds line breaks (<br />) to the outputted HTML. To disable it, set define(‘WPCF7_AUTOP’, false); in wp-contact-form-7.php. Problem: When setting up the contact form, the plugin added line breaks between <a> and <span>, which interfered with the CSS layout and styling of the form.
Solution: In the plugin’s folder, the file wp-contact-form-7.php has (line 53):
if (! defined('WPCF7_AUTOP'))
define('WPCF7_AUTOP', true);
Changing the second line from ‘true’ to ‘false’ corrects the unexpected behaviour.
Discussion: The plugin developers obviously recognized that not everyone would want their posts auto-formatted, which is nice. Unfortunately, it isn’t a very well-documented feature.
Edit (2010-05-24: As per the CF7 documentation, the constant should be defined in wp-config.php, not wp-contact-form-7.php as above.

Andrew
Superb! This fixed a major difficulty that we were having with an ultra-long form.
(On a side note, do you mean changing ‘true’ to ‘false’ to correct the auto-formatting?)
Thanks again!
2009-02-19 10:32 am