# "Confirm Email" Check for Fluent Forms

> Makes visitors type their email address twice in a Fluent Forms form and shows an error when the two do not match, so you do not lose replies to typos.

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

## Code

```php
$wpide_ff_email_name   = 'email';
$wpide_ff_confirm_name = 'email_confirm';

add_filter( 'fluentform/validation_errors', function ( $errors, $data ) use ( $wpide_ff_email_name, $wpide_ff_confirm_name ) {
    if ( ! isset( $data[ $wpide_ff_confirm_name ] ) ) {
        return $errors;
    }

    $email   = strtolower( trim( (string) ( isset( $data[ $wpide_ff_email_name ] ) ? $data[ $wpide_ff_email_name ] : '' ) ) );
    $confirm = strtolower( trim( (string) $data[ $wpide_ff_confirm_name ] ) );

    if ( $email !== $confirm ) {
        $errors[ $wpide_ff_confirm_name ] = array( 'The email addresses do not match.' );
    }

    return $errors;
}, 10, 2 );
```

## Notes

Add a second email field named email_confirm to the form, or change both names at the top.

## How to use it

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