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
- Find out if logged in user is not subscriber
- User-edit role setting distinct from wp_capabilities? [closed]
- Delete all subscribers from wp_users and wp_usermeta a few thousand at a time
- Remove email verification when new user register
- How to change user`s avatar?
- How to display custom user meta from registration in backend?
- Grouping users under parent user
- How to update user role without logout
- How to create a public profile for authors/contributors/users?
- How we can get the user id by its display_name
- WP_User_Query with combined meta query – not working?
- wp_insert_user is not working for me?
- How to customize wp_signon()
- Is it possible to get a user with just the password field?
- Make attachment pages require a base url
- How to add country drop down menu to the user profile?
- Limit number of posts a user can make per minute?
- User ability to favorite or ‘like’ content
- A way to count logged in users and display count?
- stop login if user_status equal zero
- Disable user profile editing for one user
- Rule to redirect non logged in User to Custom Registration/login Page in .htaccess file
- How do i make my wordpress website private?
- Non latin post slug truncate
- Allow Chinese character on post URL slug
- wordpress user roles are not working
- What is proper way to store info such as user marking a post as favorite? In post meta or user meta?
- What are some best practices for user exit strategy?
- Is there a way to identify a user in a custom REST API method? [duplicate]
- WP_User_Query – searching multiple fields
- wordpress disable login for unverified user
- Profile page for user roles
- Search Function on a plugin WordPress User
- Print profile details as PDF or from modal window
- Get user by meta key – WP multi site
- Force users to use password with specifications
- Give users alternative/second avatar that is rectangle sized
- Inserting current user ID into Post for Author
- Difference between is_user_logged_in and $_session[‘uname’]
- Using get_user in wordpress with sorting
- How can I add authors in WordPress and assign them a picture?
- wp_generate_password sets password but can’t login using created password
- How to verify which WordPress user requested the API in ASP .NET Core?
- Get users meta and show to attribute
- Custom Password Reset
- Can I add a unique code for each user based on the location?
- Is nicename the same as nickname in WP?
- 502 Error when edit some users
- How to update a user with REST API v2 knowing only the username?
- Display recent members
- To save user info on the same page by form submiting
- Groups roles & capabilities
- How can I output the slug of a comment author?
- Button for users to upgrade their user role + Button to show current user role!
- How do I Limit the number of pages a non-subscriber can see?
- International characters in slugs to redirect to
- Retrieve New user’s ID
- Display Plugin information on specific url
- Restrict access to certain dashboard pages based on user id
- how to show logged in members username in wordpress content
- How to expire guest users after 1.5 hours logged in?
- Change get_author_posts_url / Author URL via filter
- Wordpres password as plain text in email