How to Change WordPress Email From Sender Name Email Settings Without Plugin

Do you know best things about WordPress not only CMS but it is an application framework, it comes with a huge selection of utility functions that make it easy to handle form helpers, validation, file structures, email encoding and much more.

We can easily customize existing actions and filters with WordPress which allows you to override the core WordPress functions with any code you want. The pluggable functions can be included in the functions.php file or in your own plugins to produce new functionality for the functions already used in WordPress.

In this tutorial, we are going to show you how to Change WordPress Email “Send From” Settings. By default, your WordPress installation sends user registration emails from “wordpress@domainname.com” For example, if your blog is at site.domainname.com, emails will come from wordpress@domainname.com.

Change the from email address in WordPress

Here are snippets for changing the “from email address” in WordPress just copy below code and past into theme function.php file:

function phpkida_filter_wp_mail_from($email){
    return "contact@phpkida.com";
}
add_filter("wp_mail_from", "phpkida_filter_wp_mail_from");

Change the email from name in WordPress

Here’s the snippet for changing the “from email name” in WordPress just copy below code and past into theme function.php file:

function phpkida_filter_wp_mail_from_name($name){
    return "PHPkida Team";
}
add_filter("wp_mail_from_name", "phpkida_filter_wp_mail_from_name");

Change the password reset mail title in wordpress

function my_retrieve_password_subject_filter($old_subject) {
    // $old_subject is the default subject line created by WordPress.
    // (You don't have to use it.)

    $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
    $subject = sprintf( __('[%s] Password Reset'), $blogname );
    // This is how WordPress creates the subject line. It looks like this:
    // [Doug's blog] Password Reset
    // You can change this to fit your own needs.

    // You have to return your new subject line:
    return $subject;
}

Change the password reset mail message in wordpress

function my_retrieve_password_message_filter($old_message, $key) {
    // $old_message is the default message already created by WordPress.
    // (You don't have to use it.)
    // $key is the password-like token that allows the user to get 
    // a new password

    $message = __('Someone has asked to reset the password for the following site and username.') . "\r\n\r\n";
    $message .= network_site_url() . "\r\n\r\n";
    $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
    $message .= __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\r\n\r\n";
    $message .= network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . "\r\n";

    // This is how WordPress creates the message. 
    // You can change this to meet your own needs.

    // You have to return your new message:
    return $message;
}

// To get these filters up and running:
add_filter ( 'retrieve_password_title', 'my_retrieve_password_subject_filter', 10, 1 );
add_filter ( 'retrieve_password_message', 'my_retrieve_password_message_filter', 10, 2 );

Author: Mukesh Jakhar

This is Mukesh Jakhar. I’m a professional web developer with 3+ years experience. I am always ready for freelance work and i am writing blogs in my free time. I love to learn new technologies and share with others.
I founded PHPKIDA in September 2015. The focus of this website to provide web development tutorials of PHP, WordPress, CodeIgniter, Jquery, MySQL, HMTL, CSS etc and sharing solution of problems which i already solved.

1 thought on “How to Change WordPress Email From Sender Name Email Settings Without Plugin”

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts: You may like

How to Add Post Thumbnail to RSS Feed in WordPress

How to track contact form 7 form in salesforce without plugin

Contact Form 7 Redirect to Thank You Page

How to Validation Business Email in Contact Form 7 WordPress

How to Create and get WordPress Custom Field

How to add post from frontend in wordpress without plugin

WordPress Websites Are SEO Friendly Or Not

How to get last insert id in WordPress

How to Create Custom Shortcodes in WordPress

how to fetch custom post by tags in WordPress

PHPKIDA Offering Free Tools:

INSTA DOWNLOADER

Free online tool to download Instagram videos, photos and save Instagram videos, photos to your device. It's free & easy to use.

Download Now

CURRENCY CONVERTER

Our real time currency converter calculator will convert your money based on current values from around the world. It's free & easy to use.

Convert Now

ROBOST.TXT GEN.

Create robots txt file that help search engines to crawling and indexing your site with help of our free online Robots.txt Generator tool.

Create Now

HTML MINIFIER

Free online tool to minify or compress html code and reduce the size of html code in few clicks. It's free & easy to use.

Minify Now

CSS MINIFIER

Free online tool to minify or compress css code and reduce the size of css code in few clicks. It's free & easy to use.

Minify Now

JAVASCRIPT MINIFIER

Free online tool to minify or compress javascript code and reduce the size of javascript code in few clicks. It's free & easy to use.

Minify Now

Sign up for weekly update

Milkshake is almost ready. If you're interested in testing it out, then sign up below to get exclusive access.