Contact Form 7 Modules – A Plugin

Check out our Contact Form 7 Newsletter Plugin

Easily add Contact Form 7 form submissions to a newsletter list!  Check it out today.

Download the Contact Form 7 Modules plugin from WordPress.org

Add hidden fields to Contact Form 7

I love the Contact Form 7 plugin, and use it for many of my projects…but one thing it misses is the ability to add hidden fields. The Contact Form 7 Modules plugin adds hidden fields to Contact Form 7 in a way that will not break in future upgrades. It’s simple: install the plugin, then edit your form!

Add Every Form Field to Emails At Once

Contact Form 7 makes you copy and paste each of your form’s fields into the email message. This can take a while, and means that if you add a field in the future but forget to put it in your email, you won’t get sent that piece of information.

Now, with the All Fields Module (included in Contact Form 7 Modules plugin), you only need to add one tag to receive every submitted field: `[all-fields]`

Did this make your life easier? Was this information worth a buck?
Donate with PayPal (Much appreciated!)

  • http://trampleasure.net/lee Lee Trampleasure

    I posted this question on the WP support forum as well, but thought I might get a faster answer here, so here it is again:

    I need to send an email to a sendmail bot with the following PHP mail function:
    mail(to,subject,message,headers,parameters)
    I can get it to do everything except add the last parameter (it needs to be -f –using the Contact Form 7 code to extract the email address).

    Will this plug in do this for me?

    Thanks.

    • http://www.seodenver.com Zack Katz

      I would post that question on the website of the plugin itself, not only the WordPress.org support page.

  • Richard

    i tried to put a template tag “” inside y hidden field but dosent work, anywone can help me please.

    • http://www.seodenver.com Zack Katz

      Please put the code inside <code> and </code> tags, so that it shows up in your comment.

  • Len

    Hi Zack,
    How can we include the %post_title% from which the contact form was embedded ? Possibly the post title could be the default value of a text field which is then sent in the “additional headers” section…
    Regards,
    Len

    • http://www.seodenver.com Zack Katz

      I believe that would need to be a different module. You could just modify this, if you wanted to… I don’t have the time right now.

    • http://1manfactory.com Juergen

      You can include the title and the url with the most current version of Form 7. Look out for special mail tags in the FAQ
       

  • Hasnain Saleem

    Great work. Seems like it will work with only 2.0 (and not 2.0.1, which is the current version). Let me try to get my hands dirty and see if I can help.

    • http://www.seodenver.com Zack Katz

      I’ve updated the module for 2.0.1 — here’s a download link.

      • http://www.getbalivillas.com wieyoga

        The link its not work
        Invalid File ID or File Name.

  • Courtney

    When I move over the files, I get this error:

    Fatal error: Call to undefined function wpcf7_admin_url() in /home/content/i/n/t/intweb/html/getintouch/wp-content/plugins/contact-form-7/admin/admin-panel.php on line 40

  • Courtney

    So, I looked at the original admin.php file and it has a function called “wpcf7_admin_url” which is missing from your new one, which overwrote it. When I added function into your admin.php, the error went away.

    • http://www.seodenver.com Zack Katz

      Thanks for the heads up, I will look into it.

      Just to check, did you download the correct version? There are two versions: 2.0 and 2.0.1.

    • http://www.seodenver.com Zack Katz

      I’m not sure how that happened, but I’ve fixed this in the downloadable version. Thanks for your help!

  • Hasnain Saleem

    Thanks a ton! I was trying to reverse engineer the “text” handler, but somehow that didn’t seem to work. I’ve installed the updated version, but the admin panel for CF 7 doesn’t load and the module doesn’t seem to work. I guess my PHP error messages are disabled, as I don’t get to see any error messages.

  • Hasnain Saleem

    Update: Deleted the admin files, left the module file in place. Hidden fields are now parsed in generated forms. But when the forms are submitted, the placeholders [place-holder] are not replaced.

  • Bart

    Thanks Courtney, I had the same error.

    The function was left out of the Misc. section of the 2.0.1 update file.

    Seems to be fine now.

    Thanks for a great plugin

  • Hasnain Saleem

    Update 2: I uploaded the file “hidden.php” to the modules directory, and manually copied the changes to “admin.php” and “wpcf7-admin.js” in the admin folder. All works well now.

  • Aga Tambor

    How can I add value to hidden field in this plugin?
    Can somebody give example of use?

    Thanks

  • http://www.barrelofcrafts.com Small Business Help

    Thanks for the great update to this plugin. I’m a little surprised it doesn’t natively come with hidden fields options. Hidden fields are an excellent way to get info from form submissions.

    • http://1manfactory.com Juergen

      You are right.
      I am also very desperate to use of hidden fields

  • Catalin HODIS

    I need the value of the hidden field to be set from the query string.
    Any ideas how to do this?

    Thanks a lot!
    By the way it’s an update, to this great plugin, very helpful for many.
    Tahnks again.

    • http://www.katzwebservices.com Zack Katz

      The Gravity Forms plugin has this functionality built in, as does cForms.

  • http://www.dentaly.co.il רופא שיניים

    Also looking for a solution to send query string.

  • l33r

    This doesn’t work with WP 2.8.5 and CF7 2.0.6 . Error I get in Admin is:

    Fatal error: Cannot redeclare wpcf7_admin_url() in /home/xxx/public_html/wp-content/plugins/contact-form-7/admin/admin.php on line 324

    I really need hidden fields to work with this plugin :(

    Thanks for all your help!

    • http://www.katzwebservices.com Zack Katz

      I will be updating this to work with 2.0.6 eventually, but not in the next couple of weeks. Sorry!

  • http://newportseo.com Craig Neil

    @Zack  How about in the next couple of months?  Is the download link available?

    • http://www.katzwebservices.com Zack Katz

      Hi Craig,
      I didn’t know the downloads had disappeared. They’re back up now.

      I am no longer going to support this modification, because the plugin author continues to not add this simple functionality, and the modules functionality requires modifying the plugin core files.

  • Try

    How can I make the input fields smaller in width?

  • http://www.chnana.co.il לימודים

    I heard there’s a written addition to CF7 which allows you to store query string parameters. Anyone?

  • http://www.dlocc.com Devin Walker

    Why does everyone use Contact Form 7?  CformsII is so much better and has hidden fields.

  • Alain

    Hi Zack,

    I was really looking fur such a functionality on CF7.
    Unfortunatly the file download is not working (anymore).
    Is there any chance you can fix this?

    Alain

  • רופא שיניים

    I never used in WORDPRESS because their software is really heavy and full code.
    What I do is use it very effectively YOLA From this perspective.
    Less code, less mess, less headache.

  • http://thezeitgeistmovement.com Casemon

    This looks very useful; any chance for an update for the latest Contact Form 7 (currently v2.4.1)?

    • http://www.katzwebservices.com Zack Katz

      The Contact Form 7 Modules plugin has been released and works with Contact Form 7 2.4+

  • Cazare Predeal

    What are the use of hidden fields?

  • John

    I didn’t have time to go in and make it all pretty but I was able to get the value of the hidden field to be equal to the current post name (which is actually a custom post type in this case).

    I just added this at line 117 of hidden.php:
    if ($value == 'wp-title') { global $wp_query; $value = $wp_query->post->post_name; }

    Now when formatting the hidden field in Contact-7 it should look like this:
    [hidden hidden-849 "wp-title"]

    Thought this may be helpful to those looking to add dynamic values to their hidden fields. Please let me know if this is a poor practice for some reason, I don’t have time to check it extensively at this time.

    • Jjstevens17

      Hey, thanks for adding this to the new version…. and making it pretty =)

  • churro minguez

    Hello and thanks for this great plugin…. just a question: when i put [hidden hidden-cat "post_category"]
    it is possible to get all the categories separately, not all ‘in a block’?
    I mean, if the post has two categories (cat1, cat2) i need to get in my email: [cat1] [cat2] and NOT [cat1, cat2].
    many thanks for the help..
    Churro

  • Fiona H

    I’m new to wordpress and plugins and need some help.
    I’m using contact form 7 as a booking form and have also activated the Contact Form 7 Calendar plugin to add date pickers (arrival and departure dates e.g. Thursday, December 9, 2010). I’ve just added the modules plugin (brilliant add on) and was wondering how I would go about adding a hidden field that adds the arrival and departure dates to give me the total number of nights .

    Any ideas would be much appreciated as I’ve exhausted my very limited knowledge and can’t seem to find an answer that works on google.

    THANK YOU!

  • http://bangordailynews.com William P. Davis – BDNOnline

    An FYI, I’m getting this warning: Parameter 1 to wpcf7_add_tag_generator_hidden() expected to be a reference, value given

    This corresponds to line 147 of hidden.php.

    Is there a fix for this?

    • http://www.seodenver.com Zack Katz

      I just released version 1.1.1 of the plugin that should fix this issue. I’ve never seen this error, but I believe the changes should fix it.

      • Anonymous

        Hey Zack, where do I grab the latest version of your plugin? When I click on the main link at the top of your page it defaults to another page, not ‘contact form 7 modules’ ??

        • http://twitter.com/AdamHouston Adam Houston

          I also want to download this “Contact Form 7 Modules” plugin but it seems the link to the WP plugin repository is broken. Can you please provide a link to download the plugin? Thanks!

          • http://www.katzwebservices.com Zack Katz

            Yes, WordPress has taken it down, I believe because of the Gravity Forms endorsement on the plugin page. You can contact the plugin team at WordPress and let them know you would like to have it back up.

        • http://www.katzwebservices.com Zack Katz

          here’s a link – thanks for reporting!

  • Babak

    To show the post title I believe you have to add “post_title” NOT “post-title”.

    • http://www.katzwebservices.com Zack Katz

      Yes, that was true for 1.1.1 – I’ve made it so that it works either way in 1.1.2, since the description was inaccurate before. Thanks!

  • http://vikasbruce.blogspot.com vikas gautam

    thanks for info can you tell me how to display the multiple radio button code to vertically from cntfrm7 setting

  • Thanhdathp90

    thanks u ^^^^^^

  • Julie

    Hello! I have the Contact Form in a template and am trying to get the post_url from this. Post_title could also work, basically anything that would identify which dynamically generated post it came from. I tried this plugin (thank you) but am not sure if it is intended to be used in this way. In any case, it didn’t work.

    • Nacho

      It’s been a month since you asked about this, but the way I usually work around this kind of things is with jquery, filling the field as soon as the pages loads. Something like

      $(document).ready(function(){ $(“input[name=field-currentpost]“).val(”); });

  • mose

    I scanned the comments, and I’m surprised that this has not been reported, yet. There is a bug in send-all-fields.php that registers the tag menu item with the name “hidden”, which clobbers the hidden menu. This is the original code.

    function wpcf7_add_tag_generator_all_fields() {
        if(function_exists(‘wpcf7_add_tag_generator’)) {
            wpcf7_add_tag_generator( ‘hidden’, __( ‘All Fields’, ‘wpcf7′ ),

    The solution is to change ‘hidden’ to something like ‘allfields’ or ‘all_fields’ (but not ‘all-fields’).

    • http://www.seodenver.com Zack Katz

      Wow, big oversight. I’ll fix real soon. Thanks, Russell!

  • Pingback: José Carlos Laparra » Formulario de Contacto 7

  • craig

    Hi,

    I’m trying to use php to echo the Post ‘name’ fields of Contact Form 7. For example to capture the ‘your-email’ input text field value I’m using a php if(isset($_POST['your-email'])) statement. But it’s not working. I need to capture these input fields to send out custom email messages when the form is submitted. Any suggestions? Thanks

  • thomas

    this plugin is broken with the latest update (yesterday) of cf7 :(

    • anto

      same problem :(

    • Crystal

      I’m having the same problem. Are there plans to update this extremely useful plugin? Hidden fields has been extremely useful to us.

      • Alex

        same.. il w8 1-2 days, if he don’t make some updates, il have to try fix it by mslf..

        • Alex

          Solve all problems with plugin “Contact Form 7 – Dynamic Text Extension”. Hope it helps you2.

          • Crystal

            Thank you so much Alex! Your fix worked. You made my day so much better.

          • Barbara

            Thanks Alex! This fixed my issue right away!

          • Todd

            Thanks Alex. I switched to this one base on your recommendation.

    • Chris

      A quick fix is to replace in hidden.php on line 28
      add_action(‘plugins_loaded’, ‘contact_form_7_hidden_fields’, 10);
      with
      add_action( ‘wpcf7_init’, ‘contact_form_7_hidden_fields’, 10 );
      This adds the function to contact form 7 initialization instead of the other hook

      • Chris

        or simply change priority from 10 to 11, that will work as well

      • http://katz.co/ Zack Katz

        Thanks Chris – I’ve changed this in 1.3.3.

    • http://katz.co/ Zack Katz

      This is fixed in 1.3.3.

  • Jake

    I’m hoping this plugin gets updated to work again soon..

    • http://katz.co/ Zack Katz

      This is fixed in 1.3.3, thanks @Chris.

      • Chris

        thanks for the plugin :)

  • Troglos

    [all-fields] is not working, spinning wheel rotating forever

  • aflorescu

    The best wordpress forms plugin. One issue that I have with Version 3.7.2 is that the [all-fields] is sent as a string by email “[all-fields]” instead of sending the data the user added in the fields. Is this feature working? Do I have a problem or the plugin does not support this anymore? Thanks!