Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Generate email on meta value update

WordPress triggers a custom hook when certain meta is updated, user meta counts. See updated_{$meta_type}_meta. Here’s an example use case:

add_action('updated_user_meta', function( $meta_id, $user_id, $meta_key, $_meta_value ) {
    switch ( $meta_key ) {
        case 'mobile_number':
        case 'address':

            $user = new \WP_User($user_id);

            // user
            wp_mail($user->user_email, 'Profile updated', 'Profile updated.');

            // admin
            wp_mail(get_bloginfo('admin_email'), 'Profile updated', "Profile updated for user {$user->display_name}.");
            break;
    } 
}, 0, 4);

Related Posts:

  1. How to login with email only no username?
  2. Separate registration and login for different roles
  3. Disallow user from editing their own profile information
  4. What are the differences between wp_users and wp_usermeta tables?
  5. How can I send a welcome email to a user AFTER they login for the first time?
  6. Customize wp_new_user_notification_email()
  7. Login email after registration never sent or received
  8. Display sortable User meta column in admin panel user’s page
  9. Restricting frontend acess based on user role otherwise redirect to login form
  10. Right practice to edit WP reset password email
  11. Deny a user role to log in after register
  12. Private page protected with username and password
  13. How to integrate external user tables with WP?
  14. Allow Users Only Edit Their Profile?
  15. How can I change the email sender name from wordpress to (myblogname) on the “lost password” email?
  16. Set Default User Role
  17. Lock out all WordPress Administrators except two specific users
  18. Can’t log in. WordPress says my account doesn’t exist [closed]
  19. Why is wp-login trying to send an email?
  20. Invalidate username if it contains @ symbol
  21. WordPress Login redirection according to user role
  22. Prevent Subscriber Role to login
  23. Sending new registration meta values to admin by email
  24. Can I protect a type of content site-wide with a single password?
  25. Log in with email but no password
  26. How are all users now set to inactive?
  27. Login Based on ip
  28. How is it possible to current user info on page in WordPress?
  29. URL Restrictions? Need only people who are logged in AND have a specific role (or roles) to access all pages for a site
  30. Updated : how to make email optional while user registration using default wordpress form
  31. Custom failed login error messages for users based on user role?
  32. Custom user roles are unable to login
  33. WordPress does not send email confirmation to newly registered users
  34. confirmation email is send from my local host registration of a user but mail will not display in there email account?
  35. Check to see if there a wordpress user account and create one if not outside of wordpress
  36. Can i login with only one account to different top leveled domain wordpress web sites?
  37. Cant login, Password MUST be reset error, after reset
  38. generate an array of user login date using update_user_meta();
  39. In Django, how do I know the currently logged-in user?
  40. Can I programmatically login a user without a password?
  41. Can’t log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
  42. Is there any way to rename or hide wp-login.php?
  43. How can I redirect user after entering wrong password?
  44. Increase of failed login attempts, brute force attacks? [closed]
  45. Login page ERROR: Cookies are blocked due to unexpected output
  46. SSO / authentication integration with external ‘directory service’
  47. Preventing session timeout
  48. How reduce wordpress login session timeout time?
  49. How to prefill WordPress registration with social details
  50. Check for correct username on custom login form
  51. get_user_meta() doesn’t include user email?
  52. I can’t access my site via wp-admin
  53. ‘Password field is empty’ error when using autofill in Chrome
  54. Removing username from the ‘wordpress_logged_in’ cookie
  55. How to show ‘login error’ and ‘lost password’ on my template page?
  56. How do you update user_email on the front end in WP 3.3?
  57. Send user activation email when programmatically creating user
  58. What is $interim_login?
  59. Custom login form
  60. How to prefill the username/password fields on the login page
  61. wp_signon returns user, but the user is not logged in
  62. wp_update_user not updating
  63. Check if user is admin by user ID
  64. Adding extra authentication field in login page
  65. Prevent wp_login_form() from redirecting to wp-admin when there are errors
  66. Create custom user role (client) that can create another custom user role (employee) of that client
  67. Query users by custom taxonomy and user role
  68. Redirect user using the ‘wp_login_failed’ action hook if the error is ’empty_username’ or ’empty_password’
  69. wp_signon() does not authenticate user guidance needed
  70. What exactly is ReAuth?
  71. Login members using web services
  72. Make my wordpress blog remember my login “forever”
  73. How to check in timber if user is loggedin?
  74. How do I change the language of only the login page?
  75. How to change the email notification recipient (user) for new comments?
  76. Disable WordPress 3.6 idle logout / login modal window / session expiration
  77. Stop WordPress from logging me out (need to keep me logged in)
  78. Woocommerce registration page [closed]
  79. How to disable autocomplete on the wp-login.php page
  80. Share login data/cookies between multiple installations
  81. Synchronize WordPress user accounts across multiple domains and installations without using WordPress MU
  82. How to pass users back and forth using session data?
  83. How do I change the logo on the login page?
  84. Why does WordPress hide the reset password key from the URL?
  85. Is it possible to sign in with user_email in WordPress?
  86. Editing ‘Password Reset’ E-mail
  87. How to use current_user_can()?
  88. Avoid to load default WP styles in login screen
  89. WordPress registration message
  90. Grouping users under parent user
  91. How to fake a WordPress login?
  92. how to display the wordpress login and register forms on a page?
  93. Does wp_logout_url() destroy a session? (Logging out question)
  94. Can not login with correct username and password
  95. Website Visible only to Registered users
  96. Create un-removeable user
  97. How can i increase the login expiration length?
  98. How do I use add_action from a class method?
  99. How to remove the WordPress logo from login and register page?
  100. How can I add a custom script to footer of login page?
Categories login Tags account, email, login, user-meta, user-roles
WordPress Customizer Panels in separate files
False Positive on has_post_thumbnail

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress