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!)
86 replies on “Contact Form 7 Modules – A Plugin”
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.
I would post that question on the website of the plugin itself, not only the WordPress.org support page.
i tried to put a template tag “” inside y hidden field but dosent work, anywone can help me please.
Please put the code inside <code> and </code> tags, so that it shows up in your comment.
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
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.
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
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.
I’ve updated the module for 2.0.1 — here’s a download link.
The link its not work
Invalid File ID or File Name.
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
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.
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.
I’m not sure how that happened, but I’ve fixed this in the downloadable version. Thanks for your help!
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.
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.
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
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.
How can I add value to hidden field in this plugin?
Can somebody give example of use?
Thanks
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.
You are right.
I am also very desperate to use of hidden fields
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.
The Gravity Forms plugin has this functionality built in, as does cForms.
Also looking for a solution to send query string.
I recommend using the Gravity Forms plugin.
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!
I will be updating this to work with 2.0.6 eventually, but not in the next couple of weeks. Sorry!
@Zack How about in the next couple of months? Is the download link available?
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.
How can I make the input fields smaller in width?
I heard there’s a written addition to CF7 which allows you to store query string parameters. Anyone?
Why does everyone use Contact Form 7? CformsII is so much better and has hidden fields.
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.
This looks very useful; any chance for an update for the latest Contact Form 7 (currently v2.4.1)?
The Contact Form 7 Modules plugin has been released and works with Contact Form 7 2.4+
What are the use of hidden fields?
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.
Hey, thanks for adding this to the new version…. and making it pretty =)
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
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!
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?
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.
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’ ??
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!
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.
here’s a link – thanks for reporting!
To show the post title I believe you have to add “post_title” NOT “post-title”.
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!
thanks for info can you tell me how to display the multiple radio button code to vertically from cntfrm7 setting
thanks u ^^^^^^
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.
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(”); });
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’).
Wow, big oversight. I’ll fix real soon. Thanks, Russell!
[…] fields to the popular Contact Form 7 plugin. Versión 1.2.1 | Por Katz Web Services, Inc. | Visitar la web del plugin Contact Form 7 Modules: Send All […]
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
this plugin is broken with the latest update (yesterday) of cf7 🙁
same problem 🙁
I’m having the same problem. Are there plans to update this extremely useful plugin? Hidden fields has been extremely useful to us.
same.. il w8 1-2 days, if he don’t make some updates, il have to try fix it by mslf..
Solve all problems with plugin “Contact Form 7 – Dynamic Text Extension”. Hope it helps you2.
Thank you so much Alex! Your fix worked. You made my day so much better.
Thanks Alex! This fixed my issue right away!
Thanks Alex. I switched to this one base on your recommendation.
Thanks 🙂 a lot
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
or simply change priority from 10 to 11, that will work as well
Thanks Chris – I’ve changed this in 1.3.3.
This is fixed in 1.3.3.
I’m hoping this plugin gets updated to work again soon..
This is fixed in 1.3.3, thanks @Chris.
thanks for the plugin 🙂
[all-fields] is not working, spinning wheel rotating forever
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!
Hi, Zack! I have a great hope you’ll answer my request.
Link with “css=1” (show content only+css-styles) doen’t work correctly. It shows only content.
I’m trying to load by this link ContactForm7. Form appears but doesn’t have it’s styles
how can i save data submitted on form to a file?
Please can you fix this?! I’ve spent hours trying to figure out what’s going on!!
Would love to see an option for Parent Title as one of the hidden fields:
case ‘parent_title’:
case ‘parent-title’:
if($post->post_parent>0) {
$parent = get_post($post->post_parent);
$value = $parent->post_title;
}
break;
[…] https://katz.co/contact-form-7-hidden-fields/ […]
hello, since the today update the plugin to send email that we use (Postie) send wrongs all the field, just empty all of them, please help.
asis
and when back to the previosu version…. everything goes right. please, any ideas to help?
thanks in advanced.
What types of fields can be hidden? Can we have hidden dropdown or checkboxes?
Only text fields.
I would like to know if we I can use geolocation from Google maps integrated in the address field.
I installed the plugin but the [all-fields] tag isn’t working. The message body just says [all-fields].