WordPress at a glance
function is not described

wp_add_post_tags() WP 2.3.0

Add tags to a post.

No Hooks.


Array|false|WP_Error. Array of affected term IDs. WP_Error or false on failure.


wp_add_post_tags( $post_id, $tags );
The Post ID. Does not default to the ID of the global $post.
An array of tags to set for the post, or a string of tags separated by commas.
Default: ''


  • See: wp_set_post_tags()


Since 2.3.0 Introduced.

Code of wp_add_post_tags() WP 5.7.1

function wp_add_post_tags( $post_id = 0, $tags = '' ) {
	return wp_set_post_tags( $post_id, $tags, true );