How to disable automatic tag conversion on contact forms

WordPress has a feature that automatically converts line breaks and paragraphs in posts into <br> and <p> tags. However, this feature can cause problems when coding tags directly within contact forms and other forms, causing <br> and <p> to appear in unintended places.

To disable this feature in a template, use the following code: <?php remove_filter

<?php remove_filter ('the_content', 'wpautop'); ? > 
<?php echo do_shortcode(''); ? >

This code will disable the automatic conversion of tags (wpautop) in the post.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top