# Personal WPForms Confirmation Message

> Greets visitors by their first name in the WPForms confirmation message after submitting, which feels friendlier than a generic thank-you.

- Type: PHP
- Runs: Run everywhere
- Category: [Forms](https://wpide.com/library/category/forms/)
- Tags: wpforms, confirmation, messages
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/wpforms-personal-confirmation/

## Code

```php
$wpide_wpf_greeting = 'Thanks, %s!'; // %s is the first name.

add_filter( 'wpforms_frontend_confirmation_message', function ( $message, $form_data, $fields ) use ( $wpide_wpf_greeting ) {
    foreach ( (array) $fields as $field ) {
        if ( isset( $field['type'] ) && 'name' === $field['type'] && ! empty( $field['value'] ) ) {
            $first = ! empty( $field['first'] ) ? $field['first'] : strtok( (string) $field['value'], ' ' );
            return '<p class="wpide-greeting"><strong>' . esc_html( sprintf( $wpide_wpf_greeting, $first ) ) . '</strong></p>' . $message;
        }
    }

    return $message;
}, 10, 3 );
```

## Notes

Uses the first Name field; the greeting is added before your existing confirmation text.

## How to use it

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