Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.