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

Can someone explain the differences or different uses of the user_name and user_nicename fields in the users table? They seem to be, and behave the same.

I found a bunch of posts in web searches, but they are relevant only to older version of wp.

share|improve this question
up vote 6 down vote accepted

The nicename is (usually) just a sanitized version of the username. It's suppose to be 'nice' in the sense that it is the 'nicename' that is used as a slug, for example:


will take you to the archive of the author with nicename 'my-nice-name'.

The documentation simply describes it as

A string that contains a nicer looking name for the user.

share|improve this answer
Thanks - what type of characters are allowed during sign-up that would be removed during "sanitization"? – robarwebservices Feb 18 '12 at 13:28
sanitize_title does the sanitizing. According to this it strips HTML & PHP tags. It seems to replace spaces with '-' somewhere. Note if you provide a nicename in wp_insert_user it doesn't do any sanitizing. – Stephen Harris Feb 18 '12 at 13:47
Got it... makes perfect sense. – robarwebservices Feb 18 '12 at 15:51

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.