# One Fluent Forms Submission per Email per Day

> Stops the same email address from submitting a Fluent Forms form more than once in 24 hours, useful for giveaways, trials and quote requests.

- Type: PHP
- Runs: Run everywhere
- Category: [Forms](https://wpide.com/library/category/forms/)
- Tags: fluent-forms, validation, duplicates
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/fluentforms-one-entry-per-email/

## Code

```php
$wpide_ff_daily_forms = array(); // Form IDs, e.g. array( 1 ).
$wpide_ff_daily_field = 'email';
$wpide_ff_daily_hours = 24;

$wpide_ff_daily_key = function ( $form_id, $email ) {
    return 'wpide_ff_once_' . md5( $form_id . '|' . strtolower( trim( $email ) ) );
};

add_filter( 'fluentform/validation_errors', function ( $errors, $data, $form ) use ( $wpide_ff_daily_forms, $wpide_ff_daily_field, $wpide_ff_daily_key ) {
    if ( ! in_array( (int) $form->id, array_map( 'intval', $wpide_ff_daily_forms ), true ) || empty( $data[ $wpide_ff_daily_field ] ) || ! is_string( $data[ $wpide_ff_daily_field ] ) ) {
        return $errors;
    }

    if ( get_transient( $wpide_ff_daily_key( $form->id, $data[ $wpide_ff_daily_field ] ) ) ) {
        $errors[ $wpide_ff_daily_field ] = array( 'This email address has already been used today.' );
    }

    return $errors;
}, 10, 3 );

add_action( 'fluentform/submission_inserted', function ( $entry_id, $data, $form ) use ( $wpide_ff_daily_forms, $wpide_ff_daily_field, $wpide_ff_daily_hours, $wpide_ff_daily_key ) {
    if ( in_array( (int) $form->id, array_map( 'intval', $wpide_ff_daily_forms ), true ) && ! empty( $data[ $wpide_ff_daily_field ] ) && is_string( $data[ $wpide_ff_daily_field ] ) ) {
        set_transient( $wpide_ff_daily_key( $form->id, $data[ $wpide_ff_daily_field ] ), 1, $wpide_ff_daily_hours * HOUR_IN_SECONDS );
    }
}, 10, 3 );
```

## Notes

Checks the forms and email field listed at the top; addresses are stored only as hashes in transients that expire.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "One Fluent Forms Submission per Email per Day" 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/
