daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Nov 22nd, 2017 100 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # WordPress Emails
  2.  
  3. This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.
  4.  
  5. This is accurate as of WordPress 4.9.
  6.  
  7. There are a few TODOs left. Please bear with me.
  8.  
  9. - [Comments](#comments)
  10. - [Change of Admin Email](#change-of-admin-email)
  11. - [Change of User Email or Password](#change-of-user-email-or-password)
  12. - [Automatic Updates](#automatic-updates)
  13. - [New User](#new-user)
  14. - [New Site](#new-site)
  15. - [Other](#other)
  16.  
  17. ## Comments
  18.  
  19. ### Comment is awaiting moderation
  20.     To:        Site Admin, plus post author if they can edit comments
  21.     From:      WordPress <wordpress@host>
  22.     Subject:   [%s] Please moderate: "%s"
  23.     Function:  wp_notify_moderator()
  24.     Pluggable: Yes
  25.     Filters:   comment_moderation_subject
  26.                comment_moderation_text
  27.                comment_moderation_recipients
  28.                comment_moderation_headers
  29.     Disable:   Return false from notify_moderator filter
  30.                Remove wp_new_comment_notify_moderator action on comment_post hook
  31.                "Email me whenever" on Settings -> Discussion
  32.                Overwrite the pluggable function
  33.  
  34. ### Comment has been published
  35.     To:        Post author
  36.     From:      WordPress <wordpress@host>
  37.     Subject:   [%s] Comment: "%s"
  38.                [%s] Pingback: "%s"
  39.                [%s] Trackback: "%s"
  40.     Function:  wp_notify_postauthor()
  41.     Pluggable: Yes
  42.     Filters:   comment_notification_subject
  43.                comment_notification_text
  44.                comment_notification_recipients
  45.                comment_notification_headers
  46.     Disable:   Return false from notify_post_author filter
  47.                Remove wp_new_comment_notify_postauthor action on comment_post hook
  48.                Overwrite the pluggable function
  49.                See also the hardcoded action added to wp_set_comment_status in wp_set_comment_status()
  50.  
  51. ## Change of Admin Email
  52.  
  53. ### Change of site admin email address is attempted (Prior to WordPress 4.9, this was Multisite-only)
  54.     To:        Proposed new email address
  55.     From:      WordPress <wordpress@host>
  56.     Subject:   [%s] New Admin Email Address
  57.     Function:  update_option_new_admin_email()
  58.     Pluggable: No
  59.     Filters:   new_admin_email_content
  60.     Disable:   Remove action on add_option_new_admin_email and update_option_new_admin_email hooks
  61.  
  62. ### Site admin email address is changed (WordPress 4.9+)
  63.     To:        Old site admin email address
  64.     From:      WordPress <wordpress@host>
  65.     Subject:   [%s] Notice of Admin Email Change
  66.     Function:  wp_site_admin_email_change_notification()
  67.     Pluggable: No
  68.     Filters:   site_admin_email_change_email
  69.     Disable:   Return false from send_site_admin_email_change_email filter
  70.  
  71. ### Multisite only: Change of network admin email address is attempted (WordPress 4.9+)
  72.     To:        Proposed new email address
  73.     From:      WordPress <wordpress@host>
  74.     Subject:   [%s] New Network Admin Email Address
  75.     Function:  update_network_option_new_admin_email()
  76.     Pluggable: No
  77.     Filters:   new_network_admin_email_content
  78.     Disable:   Remove action on add_site_option_new_admin_email and update_site_option_new_admin_email hooks
  79.  
  80. ### Multisite only: Network admin email address is changed (WordPress 4.9+)
  81.     To:        Old network admin email address
  82.     From:      WordPress <wordpress@host>
  83.     Subject:   [%s] Notice of Network Admin Email Change
  84.     Function:  wp_network_admin_email_change_notification()
  85.     Pluggable: No
  86.     Filters:   network_admin_email_change_email
  87.     Disable:   Return false from send_network_admin_email_change_email filter
  88.  
  89. ## Change of User Email or Password
  90.  
  91. ### User requests a password reset via "Lost your password?"
  92.     To:        User
  93.     From:      WordPress <wordpress@host>
  94.     Subject:   [%s] Password Reset
  95.     Function:  retrieve_password()
  96.     Pluggable: No
  97.     Filters:   retrieve_password_title
  98.                retrieve_password_message
  99.     Disable:   Not possible
  100.  
  101. ### User resets their password
  102.     To:        Site admin
  103.     From:      WordPress <wordpress@host>
  104.     Subject:   [%s] Password Changed
  105.     Function:  wp_password_change_notification()
  106.     Pluggable: Yes
  107.     Filters:   wp_password_change_notification_email (WordPress 4.9+)
  108.     Disable:   Remove action on after_password_reset hook
  109.                Overwrite the pluggable function
  110.  
  111. ### User attempts to change their email address (Prior to WordPress 4.9, this was Multisite-only)
  112.     To:        Proposed new email address
  113.     From:      WordPress <wordpress@host>
  114.     Subject:   [%s] New Email Address
  115.     Function:  send_confirmation_on_profile_email()
  116.     Pluggable: No
  117.     Filters:   new_user_email_content
  118.     Disable:   Remove action on personal_options_update hook
  119.  
  120. ### User changes their password
  121.     To:        User
  122.     From:      WordPress <wordpress@host>
  123.     Subject:   [%s] Notice of Password Change
  124.     Function:  wp_update_user()
  125.     Pluggable: No
  126.     Filters:   password_change_email
  127.     Disable:   Return false from send_password_change_email filter
  128.  
  129. ### User changes their email address
  130.     To:        User
  131.     From:      WordPress <wordpress@host>
  132.     Subject:   [%s] Notice of Email Change
  133.     Function:  wp_update_user()
  134.     Pluggable: No
  135.     Filters:   email_change_email
  136.     Disable:   Return false from send_email_change_email filter
  137.  
  138. ## Automatic Updates
  139.  
  140. ### Completion or failure of a background automatic core update
  141.     To:        Site admin / Network admin
  142.     From:      WordPress <wordpress@host>
  143.     Subject:   [%s] Your site has updated to WordPress %s
  144.                [%s] WordPress %s is available. Please update!
  145.                [%s] URGENT: Your site may be down due to a failed update
  146.     Function:  WP_Automatic_Updater::send_email()
  147.     Pluggable: No
  148.     Filters:   auto_core_update_email
  149.     Disable:   Return false from auto_core_update_send_email filter
  150.                Return false from send_core_update_notification_email filter
  151.  
  152. ### Full log of background update results, sent when you are using a development version of WordPress
  153.     To:        Site admin / Network admin
  154.     From:      WordPress <wordpress@host>
  155.     Subject:   [%s] There were failures during background updates
  156.                [%s] Background updates have finished
  157.     Function:  WP_Automatic_Updater::send_debug_email()
  158.     Pluggable: No
  159.     Filters:   automatic_updates_debug_email
  160.     Disable:   Return false from automatic_updates_send_debug_email filter
  161.  
  162. ## New User
  163.  
  164. ### Multisite only: An existing user is invited to a site from Users -> Add New -> Add Existing User
  165.     To:        User being invited
  166.     From:      WordPress <wordpress@host>
  167.     Subject:   [%s] Joining confirmation
  168.     Function:  wp-admin/user-new.php
  169.     Pluggable: No
  170.     Filters:   None
  171.     Disable:   Click the "Skip Confirmation Email" checkbox when adding the user
  172.  
  173. ### Multisite only: A new user is invited to a site from Users -> Add New -> Add New User
  174.     To:        User being invited
  175.     From:      [Network Name] <[network admin]>
  176.     Subject:   [%s] Activate %s
  177.     Function:  wpmu_signup_user_notification()
  178.     Pluggable: No
  179.     Filters:   wpmu_signup_user_notification_subject
  180.                wpmu_signup_user_notification_email
  181.     Disable:   Click the "Skip Confirmation Email" checkbox when adding the user
  182.                Return false from wpmu_signup_user_notification filter
  183.  
  184. ### Multisite only: A new user account is created
  185.     To:        Network Admin
  186.     From:      WordPress <wordpress@host>
  187.     Subject:   New User Registration: %s
  188.     Function:  newuser_notify_siteadmin()
  189.     Pluggable: No
  190.     Filters:   newuser_notify_siteadmin
  191.     Disable:   Filter registrationnotification option value
  192.                Remove action on wpmu_new_user hook
  193.                Toggle "Registration notification" in Network Admin -> Settings
  194.  
  195. ### Multisite only: A user has been added, or their account activation has been successful
  196.     To:        User being added
  197.     From:      [Network Name] <[network admin]>
  198.     Subject:   New %s User: %s
  199.     Function:  wpmu_welcome_user_notification()
  200.     Pluggable: No
  201.     Filters:   update_welcome_user_subject
  202.                update_welcome_user_email
  203.                See also "Welcome User Email" setting in Network Admin -> Settings
  204.     Disable:   Click the "Skip Confirmation Email" checkbox when adding the user
  205.                Return false from wpmu_welcome_user_notification filter
  206.                Remove action on wpmu_activate_user hook
  207.  
  208. ### A new user is created (@TODO: needs a lot more information here)
  209.  
  210. When a new user is created, two emails are sent from the same function. One to the site admin:
  211.  
  212.     To:        Site Admin
  213.     From:      WordPress <wordpress@host>
  214.     Subject:   [%s] New User Registration
  215.  
  216. and one to the newly created user:
  217.  
  218.     To:        User being added
  219.     From:      WordPress <wordpress@host>
  220.     Subject:   [%s] Your username and password info
  221.  
  222. Details:
  223.  
  224.     Function:  wp_new_user_notification()
  225.     Pluggable: Yes
  226.     Filters:   wp_new_user_notification_email_admin (WordPress 4.9+)
  227.                wp_new_user_notification_email (WordPress 4.9+)
  228.     Disable:   Remove wp_send_new_user_notifications action on register_new_user hook
  229.                Remove wp_send_new_user_notifications action on edit_user_created_user hook
  230.                Remove wp_send_new_user_notifications action on network_site_new_created_user hook
  231.                Remove wp_send_new_user_notifications action on network_site_users_created_user hook
  232.                Remove wp_send_new_user_notifications action on network_user_new_created_user hook
  233.                Overwrite the pluggable function
  234.  
  235. ## New Site
  236.  
  237. ### When WordPress is installed, and when a site is added to a Multisite network
  238.     To:        Site Admin
  239.     From:      WordPress <wordpress@host>
  240.     Subject:   New WordPress Site
  241.     Function:  wp_new_blog_notification()
  242.     Pluggable: Yes
  243.     Filters:   None
  244.     Disable:   Overwrite the pluggable function
  245.  
  246. ### Multisite only: New site created from Network Admin -> Sites -> Add New
  247.     To:        Network Admin
  248.     From:      Site Admin <[network admin]>
  249.     Subject:   [%s] New Site Created
  250.     Function:  wp-admin/network/site-new.php
  251.     Pluggable: No
  252.     Filters:   None
  253.     Disable:   Not possible
  254.  
  255. ### Multisite only: User registers for a new site
  256.     To:        Site Admin
  257.     From:      [Network Name] <[network admin]>
  258.     Subject:   [%s] Activate %s
  259.     Function:  wpmu_signup_blog_notification()
  260.     Pluggable: No
  261.     Filters:   wpmu_signup_blog_notification_subject
  262.                wpmu_signup_blog_notification_email
  263.     Disable:   Return false from wpmu_signup_blog_notification filter
  264.                Remove action on after_signup_site hook
  265.  
  266. ### Multisite only: User activates their new site, or site added from Network Admin -> Sites -> Add New
  267.     To:        Network Admin
  268.     From:      WordPress <wordpress@host>
  269.     Subject:   New Site Registration: %s
  270.     Function:  newblog_notify_siteadmin()
  271.     Pluggable: No
  272.     Filters:   newblog_notify_siteadmin
  273.     Disable:   Filter registrationnotification option value
  274.                Remove action on wpmu_new_blog hook
  275.                Toggle "Registration notification" in Network Admin -> Settings
  276.  
  277. ### Multisite only: User activates their new site, or site added from Network Admin -> Sites -> Add New
  278.     To:        Site Admin
  279.     From:      [Network Name] <[network admin]>
  280.     Subject:   New %s Site: %s
  281.     Function:  wpmu_welcome_notification()
  282.     Pluggable: No
  283.     Filters:   update_welcome_subject
  284.                update_welcome_email
  285.                See also "Welcome Email" setting in Network Admin -> Settings
  286.     Disable:   Return false from wpmu_welcome_notification filter
  287.                Remove action on wpmu_activate_blog hook
  288.  
  289. ## Other
  290.  
  291. ### Multisite only: Site admin deletes site from Tools -> Delete Site
  292.     To:        Site Admin
  293.     From:      WordPress <wordpress@host>
  294.     Subject:   [ %s ] Delete My Site
  295.     Function:  wp-admin/ms-delete-site.php
  296.     Pluggable: No
  297.     Filters:   delete_site_email_content
  298.     Disable:   Not possible
RAW Paste Data
Top