# Friendlier Subjects for Account Emails

> Gives WordPress's new account, password changed and email address changed emails friendlier subjects of your own, without touching the rest of the message.

- Type: PHP
- Runs: Run everywhere
- Category: [Email](https://wpide.com/library/category/email/)
- Tags: email, subject, copy
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/email-account-email-subjects/

## Code

```php
$wpide_core_subjects = array(
    'new_user'         => 'Welcome to %s – set up your account',
    'password_changed' => 'Your %s password was changed',
    'email_changed'    => 'Your %s email address was changed',
);

$wpide_site_name = function () {
    return wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
};

add_filter( 'wp_new_user_notification_email', function ( $email ) use ( $wpide_core_subjects, $wpide_site_name ) {
    if ( isset( $wpide_core_subjects['new_user'] ) ) {
        $email['subject'] = sprintf( $wpide_core_subjects['new_user'], $wpide_site_name() );
    }
    return $email;
} );

add_filter( 'password_change_email', function ( $email ) use ( $wpide_core_subjects, $wpide_site_name ) {
    if ( isset( $wpide_core_subjects['password_changed'] ) ) {
        $email['subject'] = sprintf( $wpide_core_subjects['password_changed'], $wpide_site_name() );
    }
    return $email;
} );

add_filter( 'email_change_email', function ( $email ) use ( $wpide_core_subjects, $wpide_site_name ) {
    if ( isset( $wpide_core_subjects['email_changed'] ) ) {
        $email['subject'] = sprintf( $wpide_core_subjects['email_changed'], $wpide_site_name() );
    }
    return $email;
} );
```

## Notes

Use %s for the site name; remove a line to keep WordPress's default subject for that email.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Friendlier Subjects for Account Emails" 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/
