### [How to Set a Default Date for Your Date Picker Form Field](https://wpforms.com/developers/how-to-set-a-default-date-for-your-date-picker-form-field/)

**Published:** January 19, 2021
**Author:** Editorial Team

**Excerpt:** This tutorial will show you how you can set a default date for your Date Picker field. 

**Content:**

Would you like to have your date picker load with a default date? When using the **Date Picker** format on the **Date/Time** form field, you can easily select a date from a popup window. But did you know you can also easily set a default date for this field that starts with today’s date? In this tutorial, we’ll show you how to achieve this.

It’s important to remember that if you are using a code snippet to limit the Date Picker field, any form builder options for limiting should be turned off.

## Creating the form

First, you’ll need to create your form and add the **Date/Time** form field to your form. On the **Advanced** tab, make sure you’ve selected **Date Picker** for the **Type**.

![Add a date picker to your form](https://wpforms.com/wp-content/uploads/2021/01/wpforms-date-picker-type.jpg)

If you need any assistance in creating your form, [please review this tutorial](https://wpforms.com/docs/creating-first-form/ "Creating Your First Form").

Please note the example snippets in this tutorial are specifically for single-use examples. If you’re planning on using several of these code snippets at once you’ll need to make sure each function name is unique or you can group them all into one function.

## Setting the default date

With any of the snippets, you’ll need to copy and paste them to your site. If you need help in how to add snippets to your site, [please review this tutorial. ](https://wpforms.com/developers/how-to-add-custom-php-or-javascript-for-wpforms/ "How to Add Custom PHP or JavaScript for WPForms")

#### Adding the code snippet for all date pickers

```

/**
 * Set today's date as default date for all date pickers.
 *
 * @link https://wpforms.com/developers/how-to-set-a-default-date-for-your-date-picker-form-field/
 */

function wpf_dev_date_picker_default() {
    ?>

**Categories:** Fields

**Tags:** Date Time Field, Javascript, JS

---

