Title: [response] causes invalid HTML
Last modified: August 21, 2016

---

# [response] causes invalid HTML

 *  Resolved [Dr. Ronny Harbich](https://wordpress.org/support/users/raubvogel/)
 * (@raubvogel)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/response-causes-invalid-html/)
 * Since version 3.7 [response] causes invalid HTML:
 * `<div class="ym-fbox-footer">[submit class:ym-button "Abschicken"] [response]
   </div>`
 * produces
 *     ```
       <div class="ym-fbox-footer"><input type="submit" value="Abschicken" class="wpcf7-form-control wpcf7-submit ym-button" /><br />
       <div class="wpcf7-response-output wpcf7-display-none"></div></p>
       ```
   
 * The `</p>` is wrong (additionally `<br />` is inserted – not necessary)! Please
   help, it breaks the HTML validation 🙁 Without `[response]` the HTML is fine.
 * Edit: Issue seems to be in “includes/formatting.php” which was changed in version
   3.7.
 * [https://wordpress.org/plugins/contact-form-7/](https://wordpress.org/plugins/contact-form-7/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Dr. Ronny Harbich](https://wordpress.org/support/users/raubvogel/)
 * (@raubvogel)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/response-causes-invalid-html/#post-4582100)
 * I have found the bug maybe: In includes/formatting.php:45 we have
 *     ```
       /* wpcf7: take care of [response] tag */
       $pee = preg_replace( '!<p>\s*(\[response[^]]*\])\s*</p>!', "$1", $pee );
       ```
   
 * should be changed to
 *     ```
       /* wpcf7: take care of [response] tag */
       $pee = preg_replace( '!(?:<p>)?\s*(\[response[^]]*\])\s*</p>!', "$1", $pee );
       ```
   
 * because in my case the original regex does not match (there is no leading <p>)!
   Can you fix this in the next release please?
 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/response-causes-invalid-html/#post-4582123)
 * Thanks for reporting. Maybe I can fix it in the next release.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[response] causes invalid HTML’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [html](https://wordpress.org/support/topic-tag/html/)
 * [validation](https://wordpress.org/support/topic-tag/validation/)

 * 2 replies
 * 2 participants
 * Last reply from: [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/response-causes-invalid-html/#post-4582123)
 * Status: resolved