WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi I need a simple piece of code to delete a category for a custom plugin, but I just found two function references that seems quite the same:

Function Reference: wp_delete_term

Description: Removes a term from the database.

Usage: <?php wp_delete_term( $term_id, $taxonomy, $args ) ?>

Function Reference: wp_delete_category

Description: Deletes one existing category.

Usage: <?php wp_delete_category( $cat_ID ) ?>

My question is which one I should use (just for delete a category), and what is exactly the difference (or what makes one option better than the other).

I'm thinking that the "category" is a "term" and that wp_delete_category() uses wp_delete_term() so I should use wp_delete_term() - I'm right on that or I'm missing something.


share|improve this question

wp_delete_category() is a convenient shortcut if you want to delete a category. Use it to type less.

share|improve this answer
So, you are saying that calling a function that calls another function just because you type less is the way to go ? – user983248 Nov 4 '12 at 0:22
It is also more readable and easily understood, so I'd say yes, use this specialized function instead of the general one. In the end, it's just a question of personal preference! – Olivier Nov 4 '12 at 4:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.