Title: Creates invalid user_nicename [PATCH]
Last modified: August 20, 2016

---

# Creates invalid user_nicename [PATCH]

 *  [seand11](https://wordpress.org/support/users/seand11/)
 * (@seand11)
 * [14 years ago](https://wordpress.org/support/topic/creates-invalid-user_nicename-patch/)
 * This plugin currently allows spaces and other characters in wp_users.user_nicename
   which is a problem for generating author links which will 404 because of the 
   space (%20) and other characters.
 *     ```
       diff --git a/wp-content/plugins/wordpress-social-login/includes/plugin.auth.php b/wp-content/plugins/wordpress-social-login/includes/plugin.auth.php
       index 05a0b4c..f42a944 100644
       --- a/wp-content/plugins/wordpress-social-login/includes/plugin.auth.php
       +++ b/wp-content/plugins/wordpress-social-login/includes/plugin.auth.php
       @@ -138,7 +138,7 @@ function wsl_process_login()
   
        			'first_name'    => $hybridauth_user_profile->firstName,
        			'last_name'     => $hybridauth_user_profile->lastName,
       -			'user_nicename' => $hybridauth_user_profile->displayName,
       +			'user_nicename' => $user_login,
        			'display_name'  => $hybridauth_user_profile->displayName,
        			'user_url'      => $hybridauth_user_profile->profileURL,
        			'description'   => $hybridauth_user_profile->description,
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [seand11](https://wordpress.org/support/users/seand11/)
 * (@seand11)
 * [14 years ago](https://wordpress.org/support/topic/creates-invalid-user_nicename-patch/#post-2755330)
 * Additionally here is how you can update existing improper user_nicenames from
   your database with SQL:
 * First, get a list of user_nicenames with spaces:
 *     ```
       SELECT user_nicename FROM wp_users WHERE user_nicename LIKE '% %'
       ```
   
 * If it looks good, update to replace the space with underscores:
 *     ```
       UPDATE wp_users
       SET user_nicename = replace(user_nicename, ' ', '_')
       WHERE user_nicename LIKE '% %'
       ```
   
 *  [Shivanand Sharma](https://wordpress.org/support/users/varun21/)
 * (@varun21)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/creates-invalid-user_nicename-patch/#post-2755643)
 * Works like a charm. Not only author links it also breaks user (user profile) 
   permalinks when using bbpress plugin.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Creates invalid user_nicename [PATCH]’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-social-login_a1a2bc.svg)
 * [WordPress Social Login](https://wordpress.org/plugins/wordpress-social-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-social-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-social-login/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-social-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-social-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-social-login/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Shivanand Sharma](https://wordpress.org/support/users/varun21/)
 * Last activity: [13 years, 12 months ago](https://wordpress.org/support/topic/creates-invalid-user_nicename-patch/#post-2755643)
 * Status: not resolved