Change WordPress Default Email From Name And Address

By default, WordPress uses the from name “WordPress” and address “wordpress@yourdomain.com” when it sends notifications to users. It isn’t convenient and you might want to change it into your Blog name or something like that. This tutorial will show you how to do this just with some simple code.

Open the functions.php file of your theme and paste the following code into it:
  1. add_filter('wp_mail_from', 'new_mail_from');
  2. add_filter('wp_mail_from_name', 'new_mail_from_name');
  3.  
  4. function new_mail_from($old) {
  5. return 'admin@yourdomain.com';
  6. }
  7. function new_mail_from_name($old) {
  8. return 'Your Blog Name';
  9. }

No comments:

Post a Comment