Today I want to share a simple WordPress hack that could be useful to those webmasters using WordPress email service to send alerts to their visitors automatically on signup or some other forms of notifications.
The WordPress system sends out email with the sender name as “WordPress” and you might want to change it to something that looks more customized like “Admin” or any other name of your choice. There are number of plugins that would do the same, but it basically requires change of one word from your WordPress code.
Browse to your WordPress installation path here: /wp-includes/pluggable.php
Find $from_name = ‘WordPress’; and replace the WordPress to what ever you want.
Hope this small code helped you!
thx! just what i was looking, not so keen on using pligins just for this unless using php mail is not good which I understand is the defaut, a lot go for plugins so that they use smtp
Perfect, just exactly what I was looking for, txs for such a gret tip!
So what happens when WP updates pluggable.php…
It will back to default for every update.
Thanks God WP gave us a really handy "function.php" file within our theme folder that allows us to modify some core functionalities without affecting the core files…
so just add this to your function php file (changing name and email according to your settings) and you done.
<code>
add_filter('wp_mail_from', 'new_mail_from');
add_filter('wp_mail_from_name', 'new_mail_from_name');
function new_mail_from($old) {
return 'admin@yourdomain.com';
}
function new_mail_from_name($old) {
return 'Your Blog Name';
}
</code>
that's it ! modifying core files is always a really bad idea.
This snippet works perfectly, thanks =D
Thanks Oli – That worked perfectly!
thanks Oli, its working perfectly.
thanks Joshu Thomas also
Thanks! Very useful!
Thanks! working perfectly!
Thanks! for supporting wordpress community:) I truly appreciate your effect in sharing. Thumbs Up!