I'm trying to bulk update all my users on one of my Wordpress sites to so that their nicknames aren't the default username but have the format firstname + lastname instead.
I've put together this code and have run it in PhpMyAdmin but it doesn't seem to have changed anything (although I get no errors):
UPDATE wp_users SET user_nicename = 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
)
);
Can anyone see where I'm going wrong with this?
Many thanks,
James