By default, you send your WordPress website emails as wordpress@domain.com and WordPress as the default sender (From) name. That is not always as desirable. For example, your mail can be blocked and considered spam. Do you notice that your mail will not arrive regularly and will you receive complaints? The instructions below can help you ensure that your mail is not blocked by spam checks.

Change default WordPress email address

The standard WordPress e-mail address can easily be changed with a small piece of code. You place the code in functions.php in your theme directory

// Change default e-mail FROM address
add_filter( 'wp_mail_from', your_prefix_wp_mail_from' );
function your_prefix_wp_mail_from ( $original_email_address ) {
return 'webmaster@domain.com';
}

Change default WordPress email sender name

Also, the default sender name (From name) can be customized with a simple filter. You place the code in functions.php in your theme directory.

// Change default e-mail sender name (From name)
add_filter( 'wp_mail_from_name', ' your _prefix_wp_mail_from_name' );
function your_prefix_wp_mail_from_name( $original_email_from ) {
return 'Your name';
}

Extra: Send email by default as HTML in WordPress

By default, all mail in WordPress is sent as plain text. The default email content type is text / plain. If you want to send your emails as HTML, you can customize the content type for all mails. You also do that with a simple filter that you adds to your theme functions.php.

// Change e-mail content type
add_filter( 'wp_mail_content_type', ' your _prefix_set_content_type' );
function your _prefix_set_content_type( $content_type ) {
return 'text/html';
}

Change Default E-mail And Name In WordPress
Rate this post

Reader Interactions

Leave a Reply

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