Title: wp_mail_charset
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ‘wp_mail_charset’, string $charset )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_mail_charset/?output_format=md#parameters)
 * [More Information](https://developer.wordpress.org/reference/hooks/wp_mail_charset/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_mail_charset/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_mail_charset/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_mail_charset/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/wp_mail_charset/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/wp_mail_charset/?output_format=md#wp--skip-link--target)

Filters the default [wp_mail()](https://developer.wordpress.org/reference/functions/wp_mail/)
charset.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/wp_mail_charset/?output_format=md#parameters)󠁿

 `$charset`string

Default email charset.

## 󠀁[More Information](https://developer.wordpress.org/reference/hooks/wp_mail_charset/?output_format=md#more-information)󠁿

 * The default character encoding for [wp_mail()](https://developer.wordpress.org/reference/functions/wp_mail/)
   is UTF-8. The character encoding can be changed using the `wp_mail_charset` filter.
 * While the average user is unlikely to need to change the default character encoding
   for email, users who need to send email in different languages may find this 
   filter useful.
 * UTF-8 is still the recommended default character encoding to use since it’s backward
   compatible with ASCII and can represent nearly all languages. As a result, UTF-
   8 is the most ubiquitous character encoding being used on the web. Users/developers
   typically do not need to change the character encoding in order to read/write
   foreign langauges.
 * As of [Version 3.5](https://wordpress.org/support/wordpress-version/version-3-5/),
   WordPress character encoding is no longer configurable from the Administration
   Panel and defaults to UTF-8.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/wp_mail_charset/?output_format=md#source)󠁿

    ```php
    $phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/pluggable.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/pluggable.php#L542)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/pluggable.php#L542-L542)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/wp_mail_charset/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_mail()](https://developer.wordpress.org/reference/functions/wp_mail/)`wp-includes/pluggable.php` |

Sends an email, similar to PHP’s mail function.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/wp_mail_charset/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/wp_mail_charset/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/wp_mail_charset/?output_format=md#comment-content-4824)
 2.   [Steven Lin](https://profiles.wordpress.org/stevenlinx/)  [  5 years ago  ](https://developer.wordpress.org/reference/hooks/wp_mail_charset/#comment-4824)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_mail_charset%2F%23comment-4824)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_mail_charset%2F%23comment-4824)
 4. Example Migrated from Codex:
 5. Change the character encoding to UTF-32.
 6.     ```php
        add_filter( 'wp_mail_charset', 'change_mail_charset' );
    
        function change_mail_charset( $charset ) {
        	return 'UTF-32';
        }
        ```
    
 7.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_mail_charset%2F%3Freplytocom%3D4824%23feedback-editor-4824)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_mail_charset%2F)
before being able to contribute a note or feedback.