I am having a membership site in wordpress where there are more than 10K users. Now when the user having a single word user_nicename ( http://example.com/author/james ) try to access their respective author page, then it works just perfectly fine. But when a user having user_nicename including a space character in between ( http://example.com/author/james bond ), it gets converted to this url ( http://example.com/author/james%20bond ) and redirects them to a 404 Error Page.

I have gone through some forums and everybody has suggested to modify the db value for this. Since, in my case I am having more than 10K users, its very time consuming to go to the specific table and edit the value for each particular user and moreover, I'll not prefer this solution.

Can anybody suggest me some solution for this issue?

  • Out of curiosity: how did you even manage to get spaces in your user_nicename values? – Chip Bennett Nov 15 '12 at 16:49

The user_nicename should never have spaces. It is a sanitized version of user_name, that has been sanitized (Aa-Zz,0-9,_,-) to be suitable for use as a slug.

If you have spaces in your user_nicename values, you're going to get 404 errors. To correct, you'll probably need to edit the database directly. Here are instructions, with screenshots, for doing so via PHPMyAdmin.

  • I am not sure how the user created their account but there are many cases when their nicenames are appearing with spaces. Is editing the database is the only solution for this? What will be the case when a new user again comes on the site and he encounters the same issue again? – swtshweta Nov 15 '12 at 17:15
  • Are you sure you're talking about user_nicename, rather than display_name? By default, WordPress sanitizes the nicename. – Chip Bennett Nov 15 '12 at 17:34
  • yes, I am talking about user_nicename only. For ex. I have the user_nicename as 'Jang Jaehyuk' in the db. I know that wp sanitizes the nicename, but in some cases, its not working. – swtshweta Nov 16 '12 at 4:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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