Set a Default Date in the ACF Date Picker

Quick Summary
- Set a default for an ACF Date Picker field in code with the acf/load_field filter, since the field settings offer no option.
- The filter targets the field by name or key and sets default_value, which ACF only uses when the field has no saved value.
- For today's date, current_time('Ymd') uses the site's time zone, while PHP's date() returns the UTC date in WordPress.
The ACF Date Picker field has no default value option in the field settings, but you can set one in code with the acf/load_field filter. This snippet pre-fills the reminder_date field with a fixed date. Add it to your theme’s functions.php or a custom plugin.
// Adjust reminder_date default value
add_filter('acf/load_field/name=reminder_date', function ($field) {
//$field['default_value'] = date('Ymd');
$field['default_value'] = date('2022-10-14');
return $field;
});How the ACF date picker default date works
acf/load_field/name=reminder_dateruns whenever ACF loads the field namedreminder_date. Replace the name with your own field’s name, or usekey=with the field key to target one specific field.- The function sets
$field['default_value']and returns the field. ACF only uses the default when the field has no saved value, so it affects new posts and posts where the date was never saved. date('2022-10-14')contains no date format characters, so it simply returns the text 2022-10-14. For a fixed date, a plain string does the same job.- The commented-out line sets today’s date instead, in the
Ymdformat ACF uses to store date picker values. That stored format is also what lets you sort a custom post type query by an ACF date field.
If you switch to today’s date, keep in mind that WordPress sets PHP’s time zone to UTC, so date() returns the UTC date. current_time('Ymd') gives you today’s date in the site’s own time zone.
Date fields with sensible defaults are a small part of the editing setup in the ACF themes I build; more on custom WordPress development.
Related articles
- pulling the month and day out of an ACF date: format a saved date for event badges
- why ACF still suits custom WordPress sites: the bigger picture on structured fields for editors
