Search code examples
wordpressvalidationcontact-form-7w3c-validation

Contact Form 7 : No p element in scope but a p end tag seen


I am using contact form 7 plugin on my website. Plugin shortcode generated spaces, new lines, and p tags, which w3 validator say there is not a right.

how I can change the template or fix it with other ways

enter image description here

enter image description here


Solution

  • the simple way is that add add_filter('wpcf7_autop_or_not', '__return_false'); in your functions.php

    another way is to modify/edit your form and remove all your \n (new line characters).