Change default From Email and Name in WordPress

Change default From Email and Name in WordPress. By default WordPress sends notifications to users with email address as “wordpress@yourdomain.com” and the name as “WordPress”. And from the WordPress admin dashboard there is no way to change these details.

If we want to change these to custom details, then we have to add small piece of code to functions.php file.

Change default From Email and Name in WordPress

Just copy the below lines to functions.php file.

add_filter('wp_mail_from', 'new_mail_from');
add_filter('wp_mail_from_name', 'new_mail_from_name');
 
function new_mail_from($old) {
 return 'codingcyber@gmail.com';
}
function new_mail_from_name($old) {
 return 'Coding Cyber';
}

Replace those values with your email, and Name. Try to test a notification, then you will get Email with the above mentioned address and Name.

Vivek Vengala
 

Vivek Vengala is a Online Entrepreneur, Web Developer from Hyderabad India.

Click Here to Leave a Comment Below 0 comments

Leave a Reply:

x

Join My Facebook Group to Receive Coding Tutorial for Free

email-subsribe