WP Manifestindependent plugin directory
manifest / email / wp-unicode-email-addresses

Unicode Email Addresses

A Wordpress plugin to provide support for unicode email addresses

by Arnt Gulbrandsen · github.com/arnt/wp-unicode-email-addresses · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/arnt/wp-unicode-email-addresses/archive/refs/heads/main.zip

Readme

=== Unicode Email Addresses === Contributors: agulbra Tags: email, unicode, idn, internationalization, sanitization Requires at least: 5.9 Tested up to: 7.1 Requires PHP: 7.4 Stable tag: 1.0.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accepts Unicode email addresses such as info@grå.org, and stops sanitize_email() from rewriting an address into a different address.

== Description ==

WordPress rejects info@grå.org, and it rejects 阿Q@例子.中国 and उदाहरण@उदाहरण.भारत for the same reason: is_email() allows nothing but ASCII letters, digits and a little punctuation. Mail has allowed more than that since RFC6530-3 in 2012 and services such as gmail and o365 can send to them.

This plugin replaces the validation in is_email() and sanitize_email() with a version that accepts them. It hooks the is_email and sanitize_email filters, so no Core file is touched, and deactivating the plugin restores the old behaviour exactly.

There is a second change. The Core sanitize_email() does not just clean an address up, it rewrites: One address can go in and a different, deliverable address can come out. For info@grå.org, Core produces either info@gr.org or info@gra.org depending on what keyboard was used originally.

This plugin does not do that. It repairs the mistakes that come from copying an address out of running text (surrounding whitespace, a trailing dot at the end of a sentence, that kind of thing). If what remains isn't a valid address, this plugin returns an empty string.

Punycode domains are decoded, so arnt@xn--gr-zia.org validates and comes back as arnt@grå.org. Decoding needs the intl extension; without it, addresses written in punycode are rejected rather than guessed at.

Although agulbra is listed as sole contributor to this plugin, practically all of the code was written earlier, for Core, mostly by agulbra and dmsnell with review and contributions from others. See credits below.

= What is accepted =

The addresses a user can type into the major browsers of 2026, extended with the Unicode forms of RFC6530-3. A few addresses that RFC5322 permits are rejected, because a string like`"

Read the full README on GitHub →