• Hi,

    If I create a form like this:

    <div>hi</div>
    <div>hello</div>

    Contact form 7 adds a bunch of line breaks in p-tags, resulting in a lot of unwanted whitespace:

    <div>
    	<p>hi
    	</p>
    </div>
    <p><br />
    </p>
    <div>
    	<p>hello
    	</p>
    </div>

    If I revert back to version 5.6.4 the output looks like this:

    <div>hi</div>
    <div>hello</div>

    Is this difference between 5.6.4 and 5.7 made intentionally? If so, what is the reasoning behind it?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi, I have the same issue, after upgrading to 5.7. I use this plugin on about 50 sites, so it’s a very frustrating issue. ??

    Yes same here. A fix would be needed as this affects many sites, making the form look messed up.

    Workaround until the fix: You can remove them by deleting the breaks in the contact form editor. So write the code of the contact form “in one endless line” makes them disappear.

    Hi,

    Same issue.
    This is what I add:

    <div class="wp-block-columns">
    <div class="wp-block-column">[text* FNAME id:FNAME placeholder "Name"]</div>
    </div>

    And this is what I get:

    <div class="wp-block-columns">
    	<div class="wp-block-column">
    		<p><span class="wpcf7-form-control-wrap" data-name="FNAME"><input size="40" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required" id="FNAME" aria-required="true" aria-invalid="false" placeholder="Name" value="" type="text" name="FNAME"></span>
    		</p>
    	</div>
    </div>

    And also extra paragraph below:

    <p><br>
    </p>

    Thanks

    +1

    My website has too many spaces in my contact form I do not know why! please fix this issue.

    Same here, version 5.7 breaks the design layout because adding empty

    <p><br></p>

    Can you fix it pls? ??

    Anonymous User 20348352

    (@anonymized-20348352)

    I confirm the issue, I’ve the same problem with my forms, there are extra <p> tags all of a sudden. I would highly prefer a built-in fix to revert old behavior than fixing this myself. Thanks!

    @jferezy thanks but that′s a workaround – there need to be a fix with an update from CF7. Adding code to function.php when using the plugin is not a solution.

    @kirschgrafik Yes – I spoke too soon… They need to fix it – We have so many sites that we can not manually fix in a short time frame. Hopefully they will come up with a plan shortly…

    I have found the solution to this!!

    Just go to the plugin editor and select contact form 7 and replace the following code snippet

    if ( ! defined( ‘WPCF7_AUTOP’ ) ) {
    define( ‘WPCF7_AUTOP’, true );
    }

    to

    if ( ! defined( ‘WPCF7_AUTOP’ ) ) {
    define( ‘WPCF7_AUTOP’, false );
    }

    it will resolve the issue till we’ll get the update from the CR7 developers.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Unwanted extra paragraphs since version 5.7’ is closed to new replies.