Summery Summery

Retrieve the tags for a post formatted as a string.

Syntax Syntax

get_the_tag_list( string $before = '', string $sep = '', string $after = '', int $id )

Parameters Parameters


(string) (Optional) Before tags.

Default value: ''


(string) (Optional) Between tags.

Default value: ''


(string) (Optional) After tags.

Default value: ''


(int) (Optional) Post ID. Defaults to the current post.

Return Return

(string|false|WP_Error) A list of tags on success, false if there are no terms, WP_Error on failure.

Source Source

File: wp-includes/category-template.php

function get_tag_link( $tag ) {
	return get_category_link( $tag );

 * Retrieves the tags for a post.
 * @since 2.3.0
 * @param int $post_id Post ID.
 * @return array|false|WP_Error Array of tag objects on success, false on failure.
function get_the_tags( $post_id = 0 ) {
	$terms = get_the_terms( $post_id, 'post_tag' );


Changelog Changelog

Version Description
2.3.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.