# Tidy Up Fluent Forms Submissions

> Trims spaces and lowercases email addresses in Fluent Forms submissions before they are saved, so entries and exports stay consistent.

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

## Code

```php
add_filter( 'fluentform/insert_response_data', function ( $data ) {
    foreach ( (array) $data as $key => $value ) {
        if ( ! is_string( $value ) || 0 === strpos( (string) $key, '_' ) ) {
            continue;
        }

        $value        = trim( $value );
        $data[ $key ] = false !== stripos( (string) $key, 'email' ) ? strtolower( $value ) : $value;
    }

    return $data;
} );
```

## Notes

Field names containing "email" are lowercased; other text fields are trimmed only.

## How to use it

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