WordPress – query to find term_taxonomy_id from tag name

Mysql query – Find term_taxonomy_id for a tag name

Use the following query to find term_taxonomy_id for a tag name after replacing “PHP” 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 = 'post_tag' and wp_terms.name = 'PHP';
Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit


Click here to write/view comments