Skip to content

Instantly share code, notes, and snippets.

@byronrode
byronrode / update_product_variations.sql
Created June 28, 2012 14:38
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';