Way to allow Uppercase usernames?

Hey everyone,

WPMU Dev is fantastic and firstly, we want to say thanks to all of the developers, staff, and members! You guys are GREAT! :slight_smile:

Now, when a user tries to sign up with a captial letter in the username, the following error returns:

“Only lowercase letters and numbers allowed”

We’ve looked high and low for the solution, but can’t seem to find a way to allow capital letters in the username.

A few of the items we’ve found during our search:


That is a WPMU plugin which allows you to override certain blog name restrictions (not capital letters, btw). We don’t need to override anything in the blog name, just capital letters in the username.

From the forums:


This, again, talks about the blog name (changing things directly via a hack in the wpmu-functions.php). Allowing Capital Letters in the blog name is apparently not working too well.

If someone can offer us a solution to allow capital letters in the username, that would be fantastic! Thank you!

  • StudentBuzz
    • New Recruit

    Thank you for your response. This is what we did for our own accounts but we figured that some of our members will want uppercase letters in their usernames…

    However, since we are using BuddyPress with several other plugins, when users sign up, they are able to give their blog a different subdomain than their names.

  • KevinN
    • New Recruit

    Hi, I just saw this and thought I would add an important clarification.

    DrMike, thank you for pointing out the relevant section of RFC1738. It certainly is a common thought that domains must be in lower case. However, this is not actually true. The standard requires two related things:

    1. The url scheme (e.g. http) must be in lower case. This is strict.

    2. The domain-labels must be treated in a case insensitive way, but may be provided with any mix of upper and lower case.

    These conditions are loosely indicated in section 2.1 of http://www.ietf.org/rfc/rfc1738.txt and then made unambiguously clear in the specification on page 18-20. See the definitions of domainlabel, alphadigit and alpha.

    So what does this all mean? It means that it would be perfectly safe to allow both upper and lower case in user and blog names, but they must always be compared in a case insensitive manner.

    A simple solution would be to allow either upper or lower case, but quietly convert to lower case before database insert. I had a quick poke around wp-signup.php. It doesn’t look as though this can be fixed with a plugin. Suitable hooks aren’t being used. For instance, nothing like sanitize_user is being applied to the provided user name. Pity.

  • Shawn
    • The Crimson Coder

    “A simple solution would be to allow either upper or lower case, but quietly convert to lower case before database insert”

    This is exactly what we do:

    function fixUsernameCase($username){
    $username = strtolower($username);
    return true;
    add_filter ( 'authenticate', 'fixUsernameCase', 10, 1 );

  • KevinN
    • New Recruit


    Hi Shawn,

    You have a nice idea there, but I don’t think it applies to the sign-up process.

    I think the latest version of WP actually allows capitals during login (but not signup). The current version (3.1) makes strtolower the default filter for sanitize_user. I’m not sure exactly when that change happened.

    I wonder, is there possibly some other part of your solution which handles the sign-up case? I’m trying to think of a solution that doesn’t require modifying core files.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.