Title: Default values DOB field
Last modified: August 21, 2016

---

# Default values DOB field

 *  [ultimateuser](https://wordpress.org/support/users/ultimateuser/)
 * (@ultimateuser)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/default-values-dob-field/)
 * Hi
 * The DOB field shows by default ‘9 March 1966’.
 * Where can I change these values?
 * [http://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/](http://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/)

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

 *  Plugin Author [donmik](https://wordpress.org/support/users/atallos/)
 * (@atallos)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/default-values-dob-field/#post-4111907)
 * Hi,
 * You can change in wordpress settings – General – Date Format.
 * Or you can create a filter in your functions.php like this:
 *     ```
       function my_show_field_value($value_to_return, $type, $id, $value) {
           $field = new BP_XProfile_Field($id);
           if ($type == 'birthdate') {
               // Get children.
               $childs = $field->get_children();
               $show_age = false;
               if (isset($childs) && $childs && count($childs) > 0 && is_object($childs[0])) {
                   if ($childs[0]->name == 'show_age')
                       $show_age = true;
               }
               if ($value != '') {
                   if ($show_age) {
                       $value_to_return = '<p>'.floor((time() - strtotime($value))/31556926).'</p>';
                   } else {
                       $value_to_return = '<p>'.date_i18n('Here goes your date format' ,strtotime($value) ).'</p>';
                   }
               }
           }
   
           return $value_to_return;
       }
       add_filter('bxcft_show_field_value', 'my_show_field_value', 10, 4);
       ```
   
 * Replace the sentence “Here goes your date format” with your [date format](http://codex.wordpress.org/Formatting_Date_and_Time).
 *  Thread Starter [ultimateuser](https://wordpress.org/support/users/ultimateuser/)
 * (@ultimateuser)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/default-values-dob-field/#post-4112205)
 * Sorry, I didn’t explain myself properly.
 * I mean that on my login page the default values are ‘9 March 1966’
 * It makes more sense if the date is not already filled in when a user is signing
   up.
 *  Plugin Author [donmik](https://wordpress.org/support/users/atallos/)
 * (@atallos)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/default-values-dob-field/#post-4112215)
 * Hi,
 * I believe it’s because you have default value in the database. Search this table:
   bp_xprofile_data and here you need to find the date 6 march 1966 in this format:
   
   1966-03-06 00:00:00 probably with user_id=0. If you delete this entry I think
   it will work.
 * Also, if you delete the field and you recreate it must work. I don’t know why
   this is working this way. Maybe when I have more time I can investigate why.
 *  Thread Starter [ultimateuser](https://wordpress.org/support/users/ultimateuser/)
 * (@ultimateuser)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/default-values-dob-field/#post-4112221)
 * Thanks that worked
 *  [3×7](https://wordpress.org/support/users/3x7/)
 * (@3x7)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/default-values-dob-field/#post-4112246)
 * I have a problem that for every new registration, the default values are left
   from the last registration.
 * Any help?
 *  Thread Starter [ultimateuser](https://wordpress.org/support/users/ultimateuser/)
 * (@ultimateuser)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/default-values-dob-field/#post-4112252)
 * Yes I’m having the same problem now too…
 *  Plugin Author [donmik](https://wordpress.org/support/users/atallos/)
 * (@atallos)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/default-values-dob-field/#post-4112253)
 * I don’t know why. In my test site, this is not happening. Is this happening always?
   With every registration or only with some of them?
 *  [3×7](https://wordpress.org/support/users/3x7/)
 * (@3x7)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/default-values-dob-field/#post-4112254)
 * in my case with every registration.
    I see that it’s the same with regular checkboxes
   fields, so my guess is, that’s not your plugin fault… maybe some cache issues?
 *  Plugin Author [donmik](https://wordpress.org/support/users/atallos/)
 * (@atallos)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/default-values-dob-field/#post-4112255)
 * Are the default values inserted in database with user_id = 0?

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

The topic ‘Default values DOB field’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/buddypress-xprofile-custom-fields-
   type.svg)
 * [Buddypress Xprofile Custom Fields Type](https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/buddypress-xprofile-custom-fields-type/)
 * [Active Topics](https://wordpress.org/support/plugin/buddypress-xprofile-custom-fields-type/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/buddypress-xprofile-custom-fields-type/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/buddypress-xprofile-custom-fields-type/reviews/)

 * 9 replies
 * 3 participants
 * Last reply from: [donmik](https://wordpress.org/support/users/atallos/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/default-values-dob-field/#post-4112255)
 * Status: not resolved