Surprised to see this unanswered for this long. This is pretty simple to do with a simple block of code:
function set_my_nice_name() {
global $wpdb;
$user_table = $wpdb->prefix . 'users';
$wpdb->query("UPDATE $user_table SET `user_nicename`=`ID`");
}
add_action('init', 'set_my_nice_name');
This works because the visible portion of an author slug (or profile slug in BuddyPress) uses the user_nicename
column in the users table and this just copies the user ID to that column for everyone in the DB.
Related Posts:
- Change the Author Slug from Username to Nickname
- Getting author page slug from get_users() or get_userdata() functions
- How to let contributors to create a new revision(draft) editing their published posts
- Display posts with author in the url with custom post types
- Display edit link if post author is current user
- Force display name as full name
- Authors Page : A page of authors
- How to add wordpress username after url?
- Completely hide user info
- Total Word Count For Posts And Comments By One Author
- Users roles, make a page belonging to multiple users
- Allow UTF-8 characters in the user slug part of URL
- Is there any function available to echo current user’s profile url?
- the_author_meta(‘user_url’, $author->ID) not working properly. how can I solve this?
- Where is the information about the authors for articles stored?
- Delete User via Frontend
- How to force authors to ‘submit for review’?
- Create Next and Previous Link to User orderby Last Name
- How to change the Author Slug from Username to Nickname and deal with Special Characters
- How to implement friend system for WordPress?
- Creating User Profiles using author.php
- How can I do a url redirect to include a wordpress username?
- Author comment count in author page
- Order users by user role
- I’ve removed my /author/ slug but it clashes with new and existing pages. Any fixes?
- Change user slug in Buddypress
- How can I set wp_dropdown_users so that it shows only authors?
- How to create page for user?
- Change author base and slug in author link
- How do I tag every author in their posts that they have made previously
- How to use url formatter with integer
- Author permalink
- Change user URL
- How do I change the user via SQL?
- Add new user and user bio at same time
- show count author post today
- Link to Authors blog posts
- If the current user is an administrator or editor
- Remove slug from custom post type post URLs
- Editor can create any new user except administrator
- How do I add a field on the Users profile? For example, country, age etc
- How to check if a user (not current user) is logged in?
- How does WordPress generate URL slugs?
- How do I display logged-in username IF logged-in?
- How to allow an user role to create a new user under a role which lower than his level only?
- user_login vs. user_nicename
- How to programatically change username (user_login)?
- Remove Ability for Other Users to View Administrator in User List?
- Override default url for author pages?
- Difference between update_user_meta and update_user_option
- Make display name unique
- Make WooCommerce pages accessible for logged in users only
- Find out if logged in user is not subscriber
- WordPress usermeta scaling for thousands of users
- How to get WordPress Username in Array format
- Display user registration date
- Get multiple roles with get_users
- get_user_meta() doesn’t include user email?
- Confirmation required on email change
- How to Merge Two Authors Into One?
- Whats the best way to share user data across multiple WordPress websites?
- Using custom/dynamic “slug” for a page
- get_current_user_id() returns 0?
- How to get userid at wp_logout action hook?
- Groups of capabilities: users with multiple roles?
- Is there a way to merge two users?
- User-edit role setting distinct from wp_capabilities? [closed]
- List users by last name in WP_User_Query
- What’s the difference between the capability remove_users and delete_users?
- How to restrict access to uploaded files?
- Automatically delete inactive users after 2 months
- Use author author display name in permalink structure for pages and posts
- How to change user_login with wp-cli?
- Delete all subscribers from wp_users and wp_usermeta a few thousand at a time
- Email user when password is reset by admin
- Replacing the WordPress password validation
- Ban a user and end their session
- Allowing users to edit only their page and nobody else’s
- How can 2 blogs share the same users
- How to display a public profile page for registered users with custom slug?
- alphabetically order role drop-down selection in dashboard
- WordPress auto login after registration not working
- Execute a function when admin changes the user role
- how to use joomla password format in wordpress?
- How to do get_users() with multiple meta_keys
- Disallowing Users of a Custom Role from Deleting or Adding Administrators?
- What the user_status column?
- How to limit users to one comment per post
- Different back-end language for different users?
- Hide Admin Menu for Specific User ID who has administrator Role
- Migrating WordPress users into Disqus
- Problem with Hebrew characters in username
- Is there an upper limit for users in WP?
- How to display the status of users (online – offline) in archive.php
- Remove email verification when new user register
- How to change user`s avatar?
- Add menu and submenu in admin with a URL instead of slug?
- How to set up User email verification after Signup?
- Allow up to 5 Concurrent Login Sessions
- How to let user set password on registration