Title: Custom Default Form Template
Last modified: August 21, 2016

---

# Custom Default Form Template

 *  Resolved [Míriam de Paula](https://wordpress.org/support/users/miriamdepaula/)
 * (@miriamdepaula)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/custom-default-form-template/)
 * Hello!
 * I want to create a custom HTML form template (based in Bootstrap 3.0) for my 
   Contact Forms…
 * I found this:
 * `return apply_filters( 'wpcf7_default_template', $template, $prop );`
 * in your code, but I could not create a filter to modify the html code of the 
   default form. Is there a way to do this?
 * Thank you!
 * [https://wordpress.org/plugins/contact-form-7/](https://wordpress.org/plugins/contact-form-7/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/custom-default-form-template/#post-5118667)
 * > but I could not create a filter to modify the html code of the default form.
 * How did you do that.
 *  Thread Starter [Míriam de Paula](https://wordpress.org/support/users/miriamdepaula/)
 * (@miriamdepaula)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/custom-default-form-template/#post-5118723)
 * Hello Takayuki.. Thanks for responding….
 * My code is this: [http://pastebin.com/nnD0Jrsk](http://pastebin.com/nnD0Jrsk)
 * I know I’m doing something wrong, but what? =(
 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/custom-default-form-template/#post-5118732)
 * The content of `$template` seems ok. But this filter function makes all templates(
   form, mail, messages, …) have this content. That’s not intended, right?
 * Check how the [wpcf7_default_template filter work](https://plugins.trac.wordpress.org/browser/contact-form-7/tags/3.9/includes/contact-form.php#L816),
   what values it should input and output. Note that the filter is given two parameters.
 *  Thread Starter [Míriam de Paula](https://wordpress.org/support/users/miriamdepaula/)
 * (@miriamdepaula)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/custom-default-form-template/#post-5118744)
 * I think I understood… :S
 *     ```
       add_filter( 'wpcf7_default_template', 'base_wpcf7_default_form_template', 10, 2 );
   
       function base_wpcf7_default_form_template($template, $prop = 'form') {
       	$template =
       		'<div id="formcontato">' . "\n"
   
       .
       .
       .
       ```
   
 *  Thread Starter [Míriam de Paula](https://wordpress.org/support/users/miriamdepaula/)
 * (@miriamdepaula)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/custom-default-form-template/#post-5118748)
 * Oh no! I did something wrong … =(
 * [https://www.dropbox.com/s/jmys9d240mrnebn/WordPress.jpg](https://www.dropbox.com/s/jmys9d240mrnebn/WordPress.jpg)
 *  Thread Starter [Míriam de Paula](https://wordpress.org/support/users/miriamdepaula/)
 * (@miriamdepaula)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/custom-default-form-template/#post-5118757)
 * Hey! I did this and now works! (I think)
 * [http://pastebin.com/nnD0Jrsk](http://pastebin.com/nnD0Jrsk)

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Custom Default Form Template’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Míriam de Paula](https://wordpress.org/support/users/miriamdepaula/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/custom-default-form-template/#post-5118757)
 * Status: resolved