Title: Set Default value for text field.
Last modified: August 22, 2016

---

# Set Default value for text field.

 *  Resolved [jameya17](https://wordpress.org/support/users/jameya17/)
 * (@jameya17)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/set-default-value-for-text-field/)
 * Hi,
 *  I want show default value for one of the text field from types plugin’s custom
   fields. Is it possible to do so ?
 *  Can you please help me on this.
 * Thanks,
    Ameya
 * [https://wordpress.org/plugins/types/](https://wordpress.org/plugins/types/)

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

 *  [iworks (Marcin Pietrzak)](https://wordpress.org/support/users/iworks/)
 * (@iworks)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/set-default-value-for-text-field/#post-5445445)
 * Dear Ameya
 * Yes it is possible. You need to use this filter: `wpcf_fields_slug_(slug)_value_get`.
 * Example
 * I have a field, named “Single Line Field” width slug `single-line-field`. Then
   a function:
 *     ```
       add_filter('wpcf_fields_slug_single-line-field_value_get', 'my_default_value');
   
       function my_default_value($value)
       {
           if ( empty($value) ) {
               return 'this is default value';
           }
           return $value;
       }
       ```
   
 * you can add this code to `functions.php` of current theme.
 * cheers.
 * Marcin
 *  Thread Starter [jameya17](https://wordpress.org/support/users/jameya17/)
 * (@jameya17)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/set-default-value-for-text-field/#post-5445449)
 * Hi Marcin,
 *  Thanks for your solution. It Works perfectly for me.
 * Thanks,
    Ameya

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

The topic ‘Set Default value for text field.’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/types_ced1d3.svg)
 * [Toolset Types - Custom Post Types, Custom Fields and Taxonomies](https://wordpress.org/plugins/types/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/types/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/types/)
 * [Active Topics](https://wordpress.org/support/plugin/types/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/types/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/types/reviews/)

## Tags

 * [default value](https://wordpress.org/support/topic-tag/default-value/)

 * 2 replies
 * 2 participants
 * Last reply from: [jameya17](https://wordpress.org/support/users/jameya17/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/set-default-value-for-text-field/#post-5445449)
 * Status: resolved