I'm trying to change all the users Display Names to be their first and last name. I have looked into a number of plugins and wrote my own PHP to try and accomplish this however the site has over 50,000 registered users (I can imagine most are spam from my clients previous site) but because of this the PHP hangs and only gets to about 2000 before giving up.

So I thought that the next best thing would be to write an SQL statement from within PHPmyAdmin to perform the task, However pure SQL confuses the hell out of me and so far all I have been able to do is set the display name to be the users First name I'm not to sure how I would go about getting the Last name as well. Here is the statement that I used.

UPDATE wp_users, wp_usermeta
SET display_name = meta_value
WHERE ID = user_id
AND meta_key = 'first_name'

Any help would be appreciated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.