Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save crishnakh/86b5488611f932d85db7cec7b64d0095 to your computer and use it in GitHub Desktop.
Save crishnakh/86b5488611f932d85db7cec7b64d0095 to your computer and use it in GitHub Desktop.
WooCommerce category list SQL query
--
-- @author Gregory Karpinsky, http://www.tiv.net/
-- @version 14.05.28
--
SELECT
tp.name Cat,
t.name Subcat
FROM
wp_term_taxonomy tt,
wp_terms t,
wp_terms tp
WHERE
tt.taxonomy = 'product_cat'
AND tt.term_id = t.term_id
AND tt.parent = tp.term_id
ORDER BY
Cat,
Subcat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment