Function: get_the_tag_list

get_the_tag_list( string $before, string $sep, string $after, integer $id )

Retrieve the tags for a post formatted as a string.

Shortcut: gttl

You can use above key combination to trigger the associated snippet for this function in the WordPress Snippets for Visual Studio Code extension. You can also use this shortcut to search for this function on this website.


Name Type(s) Default Value Description
$before string ''

Optional. Before tags.

$sep string ''

Optional. Between tags.

$after string ''

Optional. After tags.

$id integer

Optional. Post ID. Defaults to the current post.


string | false | WP_Error

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

WordPress Developer Newsletter

Stay informed of new chapter releases, important WordPress API updates and more.