Skip to content

Instantly share code, notes, and snippets.

@hayakawa
Created April 19, 2017 00:56
Show Gist options
  • Save hayakawa/df8545d941a916cf39e81c07256bb9bb to your computer and use it in GitHub Desktop.
Save hayakawa/df8545d941a916cf39e81c07256bb9bb to your computer and use it in GitHub Desktop.
How to get category infomation from wordpress
SELECT a.term_id
, a.name
, a.slug
, b.count
FROM wp_terms a
LEFT JOIN wp_term_taxonomy b
ON a.term_id = b.term_id
WHERE b.taxonomy = 'category';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment