• Resolved webcpw

    (@webcpw)


    I’ve been facing an issue with Contact Form 7 where it automatically adds <p> tags around the content in the form. This is affecting the layout and formatting of my forms.

    I’ve already tried the following solutions, but the issue persists:

    Used the wpautop filter by adding the following code to my theme’s functions.php:

    add_filter('wpcf7_autop_or_not', '__return_false');

    Try to disable “wpautop” for the plugin by placing the following constant in?wp-config.php:

    define( 'WPCF7_AUTOP', false );

    None of these steps have resolved the problem, and I still see <p> tags being added around my form fields or wrappers in the output.

    Has anyone else encountered this issue? Are there specific steps or additional filters I should look at to completely disable auto-added <p> tags for Contact Form 7?

    Any advice or insights would be greatly appreciated!

    Thank you!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • If add code add_filter(‘wpcf7_autop_or_not’, ‘__return_false’); will be automatically removed and added to the tag. However, because you line the inputs, they will automatically be added to the
    tag.

    You should put the input on a line instead of a new line

    https://prnt.sc/k27oe6Ikp-Vg

    • This reply was modified 1 week, 2 days ago by Vu Tru So.
    Thread Starter webcpw

    (@webcpw)

    @vutruso , Thank you so much for taking the time to suggest a solution and share the detailed explanation, including the screenshot! I truly appreciate your effort.

    Interestingly, before I even applied your suggested fix, the issue seems to have resolved itself automatically. I checked everything again, and now there are no <p> tags being added around the form content—everything is working perfectly fine.

    This has left me a bit curious: how could this be possible? Could it be related to caching, recent plugin/theme updates, or something else in the environment? I’d love to hear your thoughts on what might have caused the issue to resolve itself without any direct intervention on my part.

    Thanks again for your help—it’s great to know there’s such a supportive community out there! ??

    I checked again and it seems your website has solved the problem, very happy about that.

    If there is a problem, don’t hesitate to create a topic, many volunteers will assist you in fixing the problem.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.