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.

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
add comment

1 Answer 1

up vote 3 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:

www.yoursite.com/author/my-nice-name/

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
add comment

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.