This tip will only work in Wordpress 4.6.0 and higher, as the funtion I’m using is less configurable in earlier versions
I recently had the need to disable the admin notification email Wordpress sends when a new user was registered programmatically.
Instead of using a plugin you can use the function
wp_new_user_notification to control who gets an email at registration time.
The function takes three parameters.
The third parameter is the one we need, it takes three diffrent values.
- admin (or empty string)
Which are pretty self-explanatory
admin sends an email to the admin,
user to the user and
both to the admin and the user.
You can read more about this function at the Wordpress documentation.
As the documentation states the function is meant to be overridden by plugins or themes, which makes it the perfect place to customize your registration mail content too.
To hook into the default registration notification you just need to unhook the default Wordpress call to the function in your theme or plugin and set it up as you need it.