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

---

# do_action( ‘edit_term’, int $term_id, int $tt_id, string $taxonomy, array $args )

## In this article

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

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

Fires after a term has been updated, but before the term cache has been cleaned.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/edit_term/?output_format=md#description)󠁿

The [‘edit_$taxonomy’](https://developer.wordpress.org/reference/hooks/edit_taxonomy/)
hook is also available for targeting a specific taxonomy.

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

 `$term_id`int

Term ID.

`$tt_id`int

Term taxonomy ID.

`$taxonomy`string

Taxonomy slug.

`$args`array

Arguments passed to [wp_update_term()](https://developer.wordpress.org/reference/functions/wp_update_term/).

More Arguments from wp_update_term( … $args )

Array of arguments for updating a term.

 * `alias_of` string
 * Slug of the term to make this term an alias of.
    Accepts a term slug.
 * `description` string
 * The term description.
 * `parent` int
 * The id of the parent term. Default 0.
 * `slug` string
 * The term slug to use.

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

    ```php
    do_action( 'edit_term', $term_id, $tt_id, $taxonomy, $args );
    ```

[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#L3428)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/taxonomy.php#L3428-L3428)

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

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

Updates term based on arguments provided.

  |

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

| Version | Description | 
| [6.1.0](https://developer.wordpress.org/reference/since/6.1.0/) | The `$args` parameter was added. | 
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |

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

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/edit_term/?output_format=md#comment-content-6611)
 2.   [shuvo586](https://profiles.wordpress.org/shuvo586/)  [  3 years ago  ](https://developer.wordpress.org/reference/hooks/edit_term/#comment-6611)
 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%2Fhooks%2Fedit_term%2F%23comment-6611)
    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%2Fhooks%2Fedit_term%2F%23comment-6611)
 4. Here is the working example for **_edit\_term_** action
 5.     ```php
        function wp_edit_term_example( $term_id, $tt_id, $taxonomy ) {
            // Return if it is not default taxonomy
            if ( 'category' !== $taxonomy ) {
                return;
            }
    
            // Get term data by term id and taxonomy
            $term = get_term( $term_id, $taxonomy );
    
            // Update term meta
            update_term_meta( $term_id, '_term_example_meta_key', 'term_example_meta_value' );
        }
    
        add_action( 'edit_term', 'wp_edit_term_example', 10, 3 );
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fedit_term%2F%3Freplytocom%3D6611%23feedback-editor-6611)

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