WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As the title says. When users register with white spaces in their usernames, if you try to go to their author page, you get a 404 error.

Is there a way to fix the redirect? or should I add a filter to prevent the use of white spaces in usernames? The site is new, so it wouldn't be hard to just change the one author with the issue.

I would think Wordpress would prevent people from having white spaces in their username.

share|improve this question
up vote 1 down vote accepted

Spaces are not allowed in URLs, so WordPress uses the user_nicename for those links. The user nice_name is "A string that contains a URL-friendly name for the user. The default is the user's username.". That is a transformed user name such that it is all lowercase with spaces replaced by dashes. I did not look up what other transformations are probably occurring.

Whatever is creating those links is doing it wrong. Without seeing the code that creates the links, it is hard to say more.

share|improve this answer
I see my problem now. I was using user_login to generate the links. Doh! – coopersita Jul 8 '13 at 16:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.