Title: wp_new_user_notification pluggable function
Last modified: August 21, 2016

---

# wp_new_user_notification pluggable function

 *  Resolved [Sam Scholfield](https://wordpress.org/support/users/sam-s/)
 * (@sam-s)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/wp_new_user_notification-pluggable-function/)
 * Hi All,
 * I’m trying to overwrite wp_new_user_notification as I don’t want to receive an
   email every time someone new registers.
 * I have copied the code from wp-includes/pluggable.php and put it into my functions.
   php file as:
 *     ```
       if ( !function_exists('wp_new_user_notification') ) :
       function wp_new_user_notification($user_id, $plaintext_pass = '') {
           $user = get_userdata( $user_id );
   
           $user_login = stripslashes($user->user_login);
           $user_email = stripslashes($user->user_email);
   
           // The blogname option is escaped with esc_html on the way into the database in sanitize_option
           // we want to reverse this for the plain text arena of emails.
           $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
   
           if ( empty($plaintext_pass) )
               return;
   
           $message  = sprintf(__('Username: %s'), $user_login) . "\r\n";
           $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
           $message .= wp_login_url() . "\r\n";
   
           wp_mail($user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);
   
       }
       endif;
       ```
   
 * You will notice I have removed the first part of the function that should email
   the admin.
 * However it’s ignoring this function and still using the default one.
 * Any ideas why?
 * Thanks,
    Sam

Viewing 1 replies (of 1 total)

 *  Thread Starter [Sam Scholfield](https://wordpress.org/support/users/sam-s/)
 * (@sam-s)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/wp_new_user_notification-pluggable-function/#post-3895384)
 * Nevermind I figured it out. You can’t put the code into functions.php. It has
   to go into a plugin.
 * Thanks anyway 🙂

Viewing 1 replies (of 1 total)

The topic ‘wp_new_user_notification pluggable function’ is closed to new replies.

## Tags

 * [email](https://wordpress.org/support/topic-tag/email/)
 * [pluggable](https://wordpress.org/support/topic-tag/pluggable/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [Sam Scholfield](https://wordpress.org/support/users/sam-s/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/wp_new_user_notification-pluggable-function/#post-3895384)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
