WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp remove object terms

Description

Remove term(s) associated with a given object.

Parameters

$object_id
(int) (required) The ID of the object from which the terms will be removed.
Default: None
$terms
(mixed) (required) The slug(s) or ID(s) of the term(s) to remove. Accepts array, int or string.
Default: None
$taxonomy
(mixed) (required) The taxonomy name. Accepts array or string.
Default: None

Return

(mixed) 
True on success, false or WP_Error on failure.

Usage

 <?php wp_remove_object_terms$id$terms$taxonomy ); ?> 

Example

Remove tag from post.

wp_remove_object_terms( $post_id, 'sweet', 'post_tag' );

Change Log

Source File

wp_remove_object_terms() is located in wp-includes/taxonomy.php.

Related

wp_add_object_terms() wp_set_object_terms()