edit_tag_link()WP 2.7.0

Displays or retrieves the edit link for a tag with formatting.

Hooks from the function


null. Nothing (null).


edit_tag_link( $link, $before, $after, $tag );
Anchor text. If empty. Default empty.
Default: 'Edit This'
Display before edit link.
Default: ''
Display after edit link.
Default: ''
Term object. If null, the queried object will be inspected.
Default: null



#1 Display the link to edit the current tag

<?php edit_tag_link(); ?>

#2 Change the link text

Let's display a link to edit tags, change the link text to "Edit tag" and "stick" that link in the html tag <p>:

<?php edit_tag_link( 'Edit tag', '<p>', '</p>' ); ?>


Since 2.7.0 Introduced.

edit_tag_link() code WP 6.4.3

function edit_tag_link( $link = '', $before = '', $after = '', $tag = null ) {
	$link = edit_term_link( $link, '', '', $tag, false );

	 * Filters the anchor tag for the edit link for a tag (or term in another taxonomy).
	 * @since 2.7.0
	 * @param string $link The anchor tag for the edit link.
	echo $before . apply_filters( 'edit_tag_link', $link ) . $after;