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

I want to do some action at the time of deleting a category using that category id. Is it possible to get the category id?

share|improve this question
up vote 1 down vote accepted

Use the delete_category action, which passes category id as an argument:

function my_category_delete_function( $id ){
    // do something with category $id
add_action( 'delete_category', 'my_category_delete_function', 10, 1 );
share|improve this answer
Thanks, it's work and similarly it's possible to get the slug of the deleted category? – Chella Durai May 4 '12 at 15:48

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.