Figured out the SQL query that can be used to reset the display_name
to first_name + last_name
. And it’s simpler than the JOIN
s that I was trying when I posted the question.
UPDATE wp_users
SET display_name = Concat(
(SELECT meta_value
FROM wp_usermeta
WHERE meta_key = 'first_name'
AND user_id = id
),
' ',
(SELECT meta_value
FROM wp_usermeta
WHERE
meta_key = 'last_name'
AND user_id = id
)
);
Related Posts:
- How can I prevent certain custom roles from seeing other custom roles on the user list page?
- List users by last name in WP_User_Query
- Wp_User_Query not sorting by meta key
- WP_User_Query with combined meta query – not working?
- pre_user_query meta_query admin user list
- Getting users who registered 360 days from current date
- Querying Email Addresses for a List of Users with Same Last Name?
- How to delete users with no order history through phpmyadmin sql?
- How to use search_columns in WP_User_Query?
- How to query users who have empty first_name?
- WordPress User getting added with id of 0
- WP User Query fails when searching meta queries and search columns
- WP User Query get all authors with last name starting with specific letter
- Getting users by specific capability, not role
- how to know when the user is in specific part of the website and when he leaves that part and display the data in the admin dashboard
- WP_User_Query – searching multiple fields
- Accessing current users data within a plugin
- How to activate the user search
- How change user type from contributor to author
- WordPress SQL Issue not returning correct reselts
- List Users alphabetically with heading
- is_user_logged_in() throwing undefined function error
- How to copy user_nicename value into user_login
- How to get the count
- SQL Bulk update all WordPress user’s nicknames to firstname + lastname format
- Display the line breaks in user bio without using html
- SELECT from wp_users, get Displayname too
- how to delete in phpmyadmin sql – all users with certain condition and all dependencies
- User with same Mail but a different additional info(like domain)
- How to get image path from id using SQL
- Cannot update newly added User field using wp_update_user
- Getting user data via ajax
- Find count of WordPress users by role and search string for user name
- Safely changing UserID’s, re-using deleted UserID’s and automatically using deleted userID’s instead of an increment
- Insert query not working for non-logged in user
- How to order posts by the user_login that corresponds to a meta_value (which is a user id)?
- Sort users by custom user meta value
- Show only users with the same role in Dashboard user list
- Transform user name before displaying
- If the current user is an administrator or editor
- Editor can create any new user except administrator
- How do I add a field on the Users profile? For example, country, age etc
- 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)?
- Change the Author Slug from Username to Nickname
- How to search for (partial match) display names of WordPress users?
- Remove Ability for Other Users to View Administrator in User List?
- 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?
- 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]
- 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
- 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
- alphabetically order role drop-down selection in dashboard
- WordPress auto login after registration not working
- Change the author slug from nickname to ID
- Execute a function when admin changes the user role
- How to let contributors to create a new revision(draft) editing their published posts
- 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?
- How to set up User email verification after Signup?
- Allow up to 5 Concurrent Login Sessions
- How to let user set password on registration
- How to hide media uploads by other users in the Media menu?
- Show admin bar only for some USERS roles
- How to display custom user meta from registration in backend?