Skip to content

Instantly share code, notes, and snippets.

@ChuckMac
Created February 17, 2015 19:05
Show Gist options
  • Save ChuckMac/49b8b1b48523d9a7d85c to your computer and use it in GitHub Desktop.
Save ChuckMac/49b8b1b48523d9a7d85c to your computer and use it in GitHub Desktop.
WooCommerce - Update Coupon Except With Note For Specific Types
UPDATE wp_posts p
INNER JOIN wp_postmeta m2
ON m2.post_id = p.id
AND m2.meta_key = 'product_ids'
SET p.post_excerpt='groupon'
WHERE p.post_type='shop_coupon'
AND ( m2.meta_value='xxx' OR m2.meta_value='yyyy' )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment