# One WPForms Submission per Email per Day

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

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

## Code

```php
$wpide_wpf_daily_forms = array(); // Form IDs to protect, e.g. array( 1 ).
$wpide_wpf_daily_hours = 24;

add_action( 'wpforms_process_validate_email', function ( $field_id, $field_submit, $form_data ) use ( $wpide_wpf_daily_forms ) {
    if ( ! in_array( (int) $form_data['id'], array_map( 'intval', $wpide_wpf_daily_forms ), true ) ) {
        return;
    }

    $email = strtolower( trim( is_array( $field_submit ) ? (string) reset( $field_submit ) : (string) $field_submit ) );

    if ( is_email( $email ) && get_transient( 'wpide_wpf_once_' . md5( $form_data['id'] . '|' . $email ) ) ) {
        $process = method_exists( wpforms(), 'obj' ) ? wpforms()->obj( 'process' ) : wpforms()->process;
        $process->errors[ $form_data['id'] ][ $field_id ] = 'This email address has already been used today.';
    }
}, 10, 3 );

add_action( 'wpforms_process_complete', function ( $fields, $entry, $form_data ) use ( $wpide_wpf_daily_forms, $wpide_wpf_daily_hours ) {
    if ( ! in_array( (int) $form_data['id'], array_map( 'intval', $wpide_wpf_daily_forms ), true ) ) {
        return;
    }

    foreach ( (array) $fields as $field ) {
        if ( isset( $field['type'] ) && 'email' === $field['type'] && is_email( $field['value'] ) ) {
            set_transient( 'wpide_wpf_once_' . md5( $form_data['id'] . '|' . strtolower( trim( $field['value'] ) ) ), 1, $wpide_wpf_daily_hours * HOUR_IN_SECONDS );
        }
    }
}, 10, 3 );
```

## Notes

Only the forms listed at the top are checked; addresses are kept only as hashes in transients that expire after the waiting period.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "One WPForms 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/
