Skip to content

Instantly share code, notes, and snippets.

@szbl
Created December 5, 2015 03:30
Show Gist options
  • Save szbl/db0e0ef384fd91e0a949 to your computer and use it in GitHub Desktop.
Save szbl/db0e0ef384fd91e0a949 to your computer and use it in GitHub Desktop.
INSERT INTO wp_usermeta
( user_id, meta_key, meta_value )
SELECT
u.ID as user_id,
'szbl_favorites' as meta_key,
pm.post_id as meta_value
FROM
wp_postmeta pm, wp_users u
WHERE
pm.meta_key = 'start_email'
AND u.user_email = pm.meta_value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment