Skip to content

Instantly share code, notes, and snippets.

@byronrode
Created June 28, 2012 14:38
Show Gist options
  • Save byronrode/3011720 to your computer and use it in GitHub Desktop.
Save byronrode/3011720 to your computer and use it in GitHub Desktop.
Update product variations using MySQL.
UPDATE wp_postmeta as pm, wp_posts as p
SET pm.meta_value = 500 /* <new price> */
WHERE pm.post_id = p.ID
AND p.post_type = 'product_variation'
AND pm.meta_key = '_price'
AND pm.meta_value = 1000 /* <old price> */
AND p.post_status = 'publish';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment