Contact Form 7

Contact form 7 multiple file upload using single file upload field

Contact form 7 set post title in textbox
Install “Contact Form 7 Dynamic Text Extension” plugin.
Then add form tag like this:

[dynamictext* dynamicname readonly "CF7_get_post_var key='title'"]

Contact form dynamic text fields

Pop up contact form 7
The easy way is show the contact form in a popup window using the plugin “Easy fancy box“.
Once you created the contact form it generate a short code something like this

[contact-form-7 id="150" title="Contact form 1"]

Now just copy the below code and paste it where you want the popup to be

<a href=“#form_pop” class=“fancybox” id=‘fancybox’ >Contact Us</a>
<div style=“display:none” class=“fancybox-hidden”>
    <div id=“form_pop”>
        [contactform7 id=“150” title=“Contact form 1”]

contact form 7 custom mail tag
Eg Code:

add_filter( 'wpcf7_special_mail_tags', 'your_special_mail_tag', 10, 3 );
function your_special_mail_tag( $output, $name, $html ) {
if ( 'yourtagname' == $name ) {
   $output = date('d/m/Y' );
return $output;

Then add [yourtagname] in your mail template.

Custom validation
Eg code:

add_filter('wpcf7_validate_text','custom_text_validation_filter', 10, 2);
add_filter('wpcf7_validate_text*', 'custom_text_validation_filter', 10, 2);
function custom_text_validation_filter($result, $tag) {
   $type = $tag['type'];
   $name = $tag['name'];
   $value = trim($_POST[$name]);
   if($name == 'subject') {
            $result->invalidate( $tag, "The field is too long.Please keep subject under 50 characters." );
         } else if (preg_match('/[\'^£$%*()}{@#~><>|=_+¬]/', $value)){
            $result->invalidate( $tag, "Invalid characters." );

Contact form 7 as registration form
Useful Links:



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s