Send Email Notification When Profile Updates

Snippets by IsItWP

Are you looking for a way to send email notification to WordPress users when their profile updates? While there’s probably a plugin for this, we have created a quick code snippet that you can use to send email notification when profile updates in WordPress.


All you have to do is add this code to your theme’s functions.php file or in a site-specific plugin:

function user_profile_update( $user_id ) {
	$site_url = get_bloginfo('wpurl');
        $user_info = get_userdata( $user_id );
        $to = $user_info->user_email; 
        $subject = "Profile Updated: ".$site_url."";
        $message = "Hello " .$user_info->display_name . "\nYour profile has been updated!\n\nThank you for visiting\n ".$site_url."";
        wp_mail( $to, $subject, $message);
add_action( 'profile_update', 'user_profile_update', 10, 2);

Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly copy / paste code snippets in WordPress, so you don’t accidentally break your site.

If you liked this code snippet, please consider checking out our other articles on the site like: 10 best WordPress testimonial plugins to add social proof and 18 Jetpack alternatives to get the features without bloat.

Comments  Leave a Reply

  1. Hello please i am new to wordpress,i want to set up multiple users which i have been able to do but also i want users to be notified via mail when new posts are added or updates are added.I read up your wordpress snippet on adding the codes u have above to function.php i cant find this function.php anywhere on my C drive.Please help out thanks

  2. its workin perfectly. but mail is showing to spam folder


    1. Not much can be down about that, I would think it has to do with spam settings.

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!