# One WPForms Submission per Logged-In User

> Lets each logged-in member submit the WPForms forms you choose only once, for surveys, votes or applications, and replaces the form with a message afterwards.

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

## Code

```php
$wpide_wpf_once_forms   = array(); // Form IDs, e.g. array( 1 ).
$wpide_wpf_once_message = 'You have already submitted this form. Thank you!';

add_filter( 'wpforms_frontend_load', function ( $load, $form_data ) use ( $wpide_wpf_once_forms, $wpide_wpf_once_message ) {
    $id = isset( $form_data['id'] ) ? (int) $form_data['id'] : 0;

    if ( $load && is_user_logged_in() && in_array( $id, array_map( 'intval', $wpide_wpf_once_forms ), true ) && get_user_meta( get_current_user_id(), '_wpide_wpf_done_' . $id, true ) ) {
        echo '<p class="wpide-wpf-once" role="status">' . esc_html( $wpide_wpf_once_message ) . '</p>';
        return false;
    }

    return $load;
}, 10, 2 );

add_action( 'wpforms_process_before', function ( $entry, $form_data ) use ( $wpide_wpf_once_forms, $wpide_wpf_once_message ) {
    $id = (int) $form_data['id'];

    if ( is_user_logged_in() && in_array( $id, array_map( 'intval', $wpide_wpf_once_forms ), true ) && get_user_meta( get_current_user_id(), '_wpide_wpf_done_' . $id, true ) ) {
        $process = method_exists( wpforms(), 'obj' ) ? wpforms()->obj( 'process' ) : wpforms()->process;
        $process->errors[ $id ]['header'] = $wpide_wpf_once_message;
    }
}, 10, 2 );

add_action( 'wpforms_process_complete', function ( $fields, $entry, $form_data ) use ( $wpide_wpf_once_forms ) {
    $id = (int) $form_data['id'];

    if ( is_user_logged_in() && in_array( $id, array_map( 'intval', $wpide_wpf_once_forms ), true ) ) {
        update_user_meta( get_current_user_id(), '_wpide_wpf_done_' . $id, time() );
    }
}, 10, 3 );
```

## Notes

List the form IDs at the top; submissions are remembered in user meta, so it works in WPForms Lite too, and logged-out visitors are not limited.

## How to use it

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