# Prefix WPForms Notification Subjects

> Adds the form name and the submitter's name to the subject of WPForms notifications, so messages are easy to tell apart and filter in your inbox.

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

## Code

```php
$wpide_wpf_subject_format = '[%1$s] %2$s – '; // %1$s form title, %2$s submitter name.

add_filter( 'wpforms_entry_email_atts', function ( $email, $fields, $entry, $form_data ) use ( $wpide_wpf_subject_format ) {
    $name = '';
    foreach ( (array) $fields as $field ) {
        if ( isset( $field['type'] ) && 'name' === $field['type'] && ! empty( $field['value'] ) ) {
            $name = (string) $field['value'];
            break;
        }
    }

    $title = isset( $form_data['settings']['form_title'] ) ? $form_data['settings']['form_title'] : '';
    $email['subject'] = trim( sprintf( $wpide_wpf_subject_format, $title, $name ) ) . ' ' . $email['subject'];

    return $email;
}, 10, 4 );
```

## Notes

Uses the first Name field of the form; change the format at the top.

## How to use it

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