WordPress change default from name and email id

 When you get any email from your self hosted WordPress website, form name of that email will be WordPress which is quite annoying to you or your clients.

You can overwrite this by adding this small piece of code in the functions.php file of your theme.

function custom_wp_mail_from_name($email_from_name) {
    return 'Your Website Name'; // Change this to your desired name
}
add_filter('wp_mail_from_name', 'custom_wp_mail_from_name');

Also you can change the default from email id of the email generated from WordPress website by adding this another function in the functions.php file of your theme.

function custom_wp_mail_from($email) {
    return 'no-reply@yourdomain.com'; // Change this to your desired email
}
add_filter('wp_mail_from', 'custom_wp_mail_from');

Comments

Popular posts from this blog

How to create dynamic HTML sitemap in WordPress with a shortcode (and exclude post types)

How to add a GST number field to WooCommerce checkout and order emails

5 websites to get icons completely free