WordPress – query to find term_taxonomy_id from category name

Mysql query – Find term_taxonomy_id from category name

Use the following query to find term_taxonomy_id for a category name after replacing “Tutorial” with the category you want to use.

select wp_term_taxonomy.term_taxonomy_id from wp_term_taxonomy join wp_terms on (wp_term_taxonomy.term_id = wp_terms.term_id)
where wp_term_taxonomy.taxonomy = 'category' and wp_terms.name = 'Tutorials';
Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit

Comments

Click here to write/view comments