# Default an ACF Date Field to Today

> Pre-fills an empty ACF date picker with today's date on new posts, saving a click for fields like "published on" or "received".

- Type: PHP
- Runs: Admin only
- Category: [Custom Post Types & Fields](https://wpide.com/library/category/post-types/)
- Tags: acf, dates, defaults
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/acf-date-default-today/

## Code

```php
// Date picker field name.
$wpide_acf_today_field = 'received_date';

add_filter( 'acf/load_field/name=' . $wpide_acf_today_field, function ( $field ) {
    if ( empty( $field['default_value'] ) ) {
        $field['default_value'] = wp_date( 'Ymd' );
    }

    return $field;
} );
```

## Notes

Uses the site's timezone. Saved dates are never changed.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Default an ACF Date Field to Today" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
