• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.3 Copy "location" data to a custom field


Well-known member
is there a way to copy the contents of the "location" field to a custom profile field?

If so what would be the SQL query?

Jake Bunce

XenForo moderator
Staff member
Usually people go the opposite direction:


If you want to go location to custom field then use this:

Rich (BB code):
UPDATE xf_user_field_value AS ufv
SET ufv.field_value = (
	SELECT up.location
	FROM xf_user_profile AS up
	WHERE ufv.user_id = up.user_id
WHERE ufv.field_id = 'customfield';
Then rebuild the user cache:

Admin CP -> Tools -> Rebuild Caches -> Rebuild User Caches

Backup to be safe.