Title: wp_delete_category
Published: April 25, 2014
Last modified: February 24, 2026

---

# wp_delete_category( int $cat_id ): bool|int|󠀁[WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)󠁿

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/wp_delete_category/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_delete_category/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_delete_category/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_delete_category/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_delete_category/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_delete_category/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_delete_category/?output_format=md#wp--skip-link--target)

Deletes one existing category.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_delete_category/?output_format=md#parameters)󠁿

 `$cat_id`intrequired

Category term ID.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_delete_category/?output_format=md#return)󠁿

 bool|int|[WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)
Returns true if completes delete action; false if term doesn’t exist; Zero on attempted
deletion of default Category; [WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)
object is also a possibility.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_delete_category/?output_format=md#source)󠁿

    ```php
    function wp_delete_category( $cat_id ) {
    	return wp_delete_term( $cat_id, 'category' );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/taxonomy.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/taxonomy.php#L2248)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/taxonomy.php#L2248-L2250)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_delete_category/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_delete_term()](https://developer.wordpress.org/reference/functions/wp_delete_term/)`wp-includes/taxonomy.php` |

Removes a term from the database.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_delete_category/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_delete_category/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/wp_delete_category/?output_format=md#comment-content-1468)
 2.   [Codex](https://profiles.wordpress.org/codex/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/wp_delete_category/#comment-1468)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_delete_category%2F%23comment-1468)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_delete_category%2F%23comment-1468)
 4. Example
 5.     ```php
        <?php
        $categ_ID = 3;
        if ( wp_delete_category( $categ_ID ) ) {
          echo "Category #$categ_ID was successfully deleted";
        } else {
          echo "Impossible to delete category #$categ_ID! Make sure it exists and that it's not the default category";
        }
        ?>
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_delete_category%2F%3Freplytocom%3D1468%23feedback-editor-1468)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_delete_category%2F)
before being able to contribute a note or feedback.