Tip: WordPress, Contact Form 7 and extra p tags in Text Area fix

February 13th, 2012

We at RIA Mobile Solutions  love wordpress and use it as a light weight CMS for simple member based sites filled with Social Media, Blogging and CMS needs.

Another plugin that we use is Contact Form 7 which is basically  used for creating simple forms. Love the way it generates clean HTML tags and we can style it as we wish.

The other day day I was creating a Pledge form for gathering support and petitions and one of the field is a text area where end users can personalize their message before submitting the petition. But I observed that contact form 7 is adding extra <p> tags and they appear to the end users.

At first I thought it might be caused by another plugin. But after some researching on Contact Form 7 found out that I need to define a flag in wp-config.php to suppress this weird behavior just like below

define ( ‘WPCF7_AUTOP’, false );

This fixed the extra p tags problem. Hope it helps others. Got to love WordPress and its community.