The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Contact Form 7 Modules
[resolved] Not getting hiden field value (2 posts)

  1. anandonnet
    Posted 4 years ago #

    I am using a URL like this


    I would like to receive the value 12345 against category variable in my email.

    I used syntact like this: [hidden hidden-271 "custom_field-category"] on the form and Category:[hidden-271] inside message body,

    I dont get a value, could you tell me how to get default value for a custom field thru query string or other modes.



  2. Zack Katz
    Plugin Author

    Posted 3 years ago #

    Use the this tag inside the form: [hidden hidden-271 id:categoryrequest] and [hidden-271] inside the message body.

    And then you can add the following code to your theme's functions.php file:

    add_filter('wpcf7_hidden_field_value_categoryrequest', 'wpcf7_hidden_field_add_query_arg');
    function wpcf7_hidden_field_add_query_arg($value = '') {
    	if(isset($_GET['category'])) {
    		return $_GET['category'];
    	return $value;

    This will achieve what you're looking to do.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7 Modules
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.