Title: Remove Span elements from Contact form 7
Last modified: August 20, 2016

---

# Remove Span elements from Contact form 7

 *  [Tom](https://wordpress.org/support/users/godsdead/)
 * (@godsdead)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/)
 * I love this simple contact form 7, although it puts in loads of un-needed html,
   which is conflicting and breaking my designs.
 * How can i stop contact form 7 from wrapping inputs in <span>, i can see adding
   code to my wp-config to disable the line breaks, but nothing to get rid of this
   annoying SPAN!
 *     ```
       <br />
                       <span class="wpcf7-form-control-wrap your-name"><input type="text" name="your-name" value="" class="wpcf7-text wpcf7-validates-as-required" size="40" /></span><br />
       ```
   
 * it would be absolutely stupid if i have to let extra un-nessasary code bloat 
   the fronted, and have to re-design AROUND it.

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/page/2/?output_format=md)

 *  [Joey Kudish](https://wordpress.org/support/users/jkudish/)
 * (@jkudish)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/#post-2090832)
 * You would have to modify the plugin itself and remove it from the functions that
   output the extra html…
 *  Thread Starter [Tom](https://wordpress.org/support/users/godsdead/)
 * (@godsdead)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/#post-2090878)
 * Balls, that means i wouldn’t be able to update the plugin!
    Looks like im going
   to have to design around it, unless you can recommend a better plugin?
 *  [Joey Kudish](https://wordpress.org/support/users/jkudish/)
 * (@jkudish)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/#post-2090890)
 * For sure that wouldn’t be great for updates.
 * I personally use Gravity Forms for all the sites that I build – [http://jkudi.sh/gravityf](http://jkudi.sh/gravityf),
   it’s by far the best forms plugin and one of the best all-around plugins ever
   built for WordPress. It does have a price tag, but a well worth one. Note: I 
   am not affiliated with them in any ways, just a user and fan of their product.
 * There’s also Grunion which is made by Automattic and a few of the core developers
   of WordPress. [http://wordpress.org/extend/plugins/grunion-contact-form/](http://wordpress.org/extend/plugins/grunion-contact-form/)
 * Good luck
 *  [kato](https://wordpress.org/support/users/kato/)
 * (@kato)
 * [15 years ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/#post-2091024)
 * Grunion is not customizable.
    Gravity forms costs money. Contact Form 7 adds 
   html that can only be removed by hacking the php files. Grr.
 * Memo to self – do not upgrade Contact Forms 7.
 * in wp-contact / plugins / contact-form-7 / text.php, change line 93 from:
 *  $html = ‘<span class=”wpcf7-form-control-wrap ‘ . $name . ‘”>’ . $html . $validation_error.‘
   </span>’;
 * to:
 *  $html = $html . $validation_error;
 * in textarea.php change line 92 from:
 *  $html = ‘<span class=”wpcf7-form-control-wrap ‘ . $name . ‘”>’ . $html . $validation_error.‘
   </span>’;
 * to:
 *  $html = $html . $validation_error;
 *  [kato](https://wordpress.org/support/users/kato/)
 * (@kato)
 * [15 years ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/#post-2091025)
 * P.S. – blank fields will no longer be automatically highlighted upon form validation
   fail. I consider this not a big deal.
 * Reminder to self: don’t upgrade Contact Form 7.
 *  [dashaluna](https://wordpress.org/support/users/dashaluna/)
 * (@dashaluna)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/#post-2091026)
 * It would be great if there was a hook into the output HTML that would allow to
   use default Contact Form 7 HTML or strip out all additional HTML that’s added.
 * Is there a way to use a WP standard hook to hook into the Contact Form 7 HTML
   structure and strip out additional HTML?
 * Thanks,
    Dasha
 *  [kato](https://wordpress.org/support/users/kato/)
 * (@kato)
 * [14 years, 12 months ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/#post-2091027)
 * Not that I know of.
 * I understand the developer needs some way to identify the bad fields on validation.
   But the more correct way to do it would be to attach a class or ID rather than
   adding new html tags. i.e. input class=”validate-name” or something.
 * Normally adding the spans don’t present any problem, but in my case, I wanted
   to use jquery sliding labels with my form and the span tags broke the script.
   It’s working now. But not in an ideal way.
 *  [kato](https://wordpress.org/support/users/kato/)
 * (@kato)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/#post-2091036)
 * For the record, the folder is:
 * wp-content/plugins/contact-form-7/modules
 * must’ve been high when i wrote that.
 * Coming back to this post as a refresher, because today I’m doing it to quiz.php
   also…
 *  [Pandonym](https://wordpress.org/support/users/pandonym/)
 * (@pandonym)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/#post-2091038)
 * Hey kato,
 * thanks for your work. I tried the same thing, but without any success 🙂
 * When I change the text.php and textarea.php as described, then my website get
   blank. Nothing works anymore. Any hint?
    When I reset the plugin (backup files)
   then everything is ok.
 *  [kato](https://wordpress.org/support/users/kato/)
 * (@kato)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/#post-2091039)
 * I’m using Version 2.4.6. Are you using the same?
 * Could be you’re missing the semi-colon at the end? PHP loses its brain when it
   can’t find a statement end.
 * If you’re using 2.4.6 you can [download my modified files](http://db.tt/ulLVDCK)
   and overwrite the ones in: wp-content/plugins/contact-form-7/modules
 * Let me know if it works!
 *  [Pandonym](https://wordpress.org/support/users/pandonym/)
 * (@pandonym)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/#post-2091040)
 * Yes, I am using the same version.
 * Semicolon is at the end of the line. Unfortunately your files didn’t change something.
   Pity!
 * Anyway I thank you 😉
 *  [kato](https://wordpress.org/support/users/kato/)
 * (@kato)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/#post-2091041)
 * Whoops. I checked the files and realized I grabbed them from the wrong WP install(
   unmodified.)
 * Here are [the corrected files](http://dl.dropbox.com/u/2911770/Wordpress/actual.zip)
   if you’re willing to try again.
 * Sorry ’bout that.
 *  [Pandonym](https://wordpress.org/support/users/pandonym/)
 * (@pandonym)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/#post-2091042)
 * Interesting,
 * today I set the report level from php to a higher level and get these error codes:
 *     ```
       Fatal error: Cannot redeclare wpcf7_quiz_shortcode_handler() (previously declared in [...]/wp-content/plugins/contact-form-7/modules/backup_quiz.php:10) in [...]/wp-content/plugins/contact-form-7/modules/quiz.php on line 88 
   
       Fatal error: Cannot redeclare wpcf7_textarea_shortcode_handler() (previously declared in [...]/wp-content/plugins/contact-form-7/modules/backup_textarea.php:11) in [...]/wp-content/plugins/contact-form-7/modules/textarea.php on line 95 
   
       Fatal error: Cannot redeclare wpcf7_text_shortcode_handler() (previously declared in [...]/wp-content/plugins/contact-form-7/modules/backup_text.php:13) in [...]/wp-content/plugins/contact-form-7/modules/text.php on line 96
       ```
   
 * I just renamed my old files as backup_*.
 * Now I deleted the original files and uploaded your corrected files and it works!
 * Thank you very much!
 *  [Steph Wells](https://wordpress.org/support/users/sswells/)
 * (@sswells)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/#post-2091051)
 * You might want to try out Formidable. The HTML is customizable, and the forms
   are easier to build than Contact Form 7. FYI, I am the main developer.
 *  [Pandonym](https://wordpress.org/support/users/pandonym/)
 * (@pandonym)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/#post-2091052)
 * I still had some problems till today!
 * I tested many other plugins and form-templates. None of them were like I wanted.
   One template didn’t allow a https-connection, I don’t know why. So I get back
   to contact form 7 plugin.
 * Now I have my problems solved. My theme has a shortcode-function “[noformat]”
   which removes unwanted formatting of WordPress and co.
    Then I get a table inside
   my CF7 inside the formbuilder (I hope you will understand me).
 * For example:
    _[Code moderated as per the [Forum Rules](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
   Please use the [pastebin](http://wordpress.pastebin.com/)]_
 * And so on…
 * Maybe this will some other people. I was so annoyed with all that stuff, but 
   now I am happy 😀
 * [@sswells](https://wordpress.org/support/users/sswells/)
    Thank you, but I don’t
   want to try out further plugins – I hope you know why 😉
 * Greets
    Pandonym

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/page/2/?output_format=md)

The topic ‘Remove Span elements from Contact form 7’ is closed to new replies.

 * 16 replies
 * 7 participants
 * Last reply from: [Andrew Tegenkamp](https://wordpress.org/support/users/andrewteg/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/remove-span-elements-from-contact-form-7/page/2/#post-2091056)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
