How to change wordpress from name and email address

How to change WordPress from name and email address, If you are using any contact form on your website and if anyone submits the form. The email will be sent from an email wordpress@yourdomainname.com and from name is WordPress. To change these values you can do it in different methods, below I’ve mentioned three methods you can follow any one of them to update WordPress default from name and email address while sending emails.

  1. Using Plugin like WP Mail From II
  2. Update pluggable.php file.
  3. Add code in functions.php file in theme directory.
1

Using Plugin like WP Mail From II

It is very simple to do the task.

  1. Goto Dashboard and click on plugins
  2. Click on “Add New”
  3. Enter the name of plugin(WP Mail From II) and press enter
  4. Click on “Install Now”. and click ok popup alert
  5. Click on “Activate Plugin”
  6. Select settings from Dashboard there we found Mail From
  7. Then enter your “From Name” and “From Email Address”
  8. Click Save.
2

Update pluggable.php file

Path of file is: WordPress root directory >wp-includes>pluggable.php

  • Search for below code in pluggable.php, path I’ve mentioned above.
    $from_name = 'WordPress';
  • Replace your required name in the place of “WordPress”. like
    $from_name = 'Your Name';
  • Search for below code in pluggable.php file
    $from_email = 'wordpress@' . $sitename;
  • Replace your address with existing site name like
    $from_email = 'yourname@website_domain_name.com'

    or

    $from_email = 'yourname@' . $sitename;
  • Save the file and test it by submitting a form in your website.
3

Add code in functions.php file in theme directory

Find functions.php file in your active theme and add this code at the end of file.

Note : The functions.php file is different for every theme. So if you change the code in your active theme and in future you replaced it with better theme then you need to add the same code to that functions.php file.
Path for adding the peace of code to functions.php:
WordPress root directory >wp-content>themes>Your_Theme>functions.php

  • Just add the below code at beginning or the end of the functions.php
  • Save the file.
/** changing default wordpres email settings */

add_filter('wp_mail_from', 'new_mail_from');
add_filter('wp_mail_from_name', 'new_mail_from_name');

function new_mail_from($old) {
 return 'your email address';
}
function new_mail_from_name($old) {
 return 'your name or your website';
}

Replace your email at

return 'your email address';

and replace your name or site name at

return 'your name or your website';

 

Incoming search terms:

  • Send to Email Address Your Name Your Email Address
Pratap Kasireddy
 

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