Gis Tricks

Finding sku’s woocommerce

Finding sku’s woocommerce

For some reason I wanted an overview of all sku’s used by woocommerce on one of my commercial websites. Quite annoying if you have to copy paste from wordpress admin interface. SQL to the rescue!


SELECT wp.guid, wpp.meta_value FROM wp_postmeta as wpp INNER JOIN wp_posts as wp ON wpp.post_id = wp.id WHERE wpp.meta_key = '_sku' AND LOWER(wp.post_title)  LIKE '%product%'

<strong>;</strong>

Simply replace product with

 

Leave a Reply

Your email address will not be published. Required fields are marked *

fourteen − 13 =