Title: trackback_url
Published: April 25, 2014
Last modified: May 20, 2026

---

# trackback_url( bool $deprecated_echo = true ): void|string

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/trackback_url/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/trackback_url/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/trackback_url/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/trackback_url/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/trackback_url/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/trackback_url/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/trackback_url/?output_format=md#wp--skip-link--target)

Displays the current post’s trackback URL.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/trackback_url/?output_format=md#parameters)󠁿

 `$deprecated_echo`booloptional

Not used.

Default:`true`

## 󠀁[Return](https://developer.wordpress.org/reference/functions/trackback_url/?output_format=md#return)󠁿

 void|string Should only be used to echo the trackback URL, use [get_trackback_url()](https://developer.wordpress.org/reference/functions/get_trackback_url/)
for the result instead.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/trackback_url/?output_format=md#source)󠁿

    ```php
    function trackback_url( $deprecated_echo = true ) {
    	if ( true !== $deprecated_echo ) {
    		_deprecated_argument(
    			__FUNCTION__,
    			'2.5.0',
    			sprintf(
    				/* translators: %s: get_trackback_url() */
    				__( 'Use %s instead if you do not want the value echoed.' ),
    				'<code>get_trackback_url()</code>'
    			)
    		);
    	}

    	if ( $deprecated_echo ) {
    		echo get_trackback_url();
    	} else {
    		return get_trackback_url();
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/comment-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/comment-template.php#L1247)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/comment-template.php#L1247-L1265)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/trackback_url/?output_format=md#related)󠁿

| Uses | Description | 
| [get_trackback_url()](https://developer.wordpress.org/reference/functions/get_trackback_url/)`wp-includes/comment-template.php` |

Retrieves the current post’s trackback URL.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [_deprecated_argument()](https://developer.wordpress.org/reference/functions/_deprecated_argument/)`wp-includes/functions.php` |

Marks a function argument as deprecated and inform when it has been used.

  |

[Show 1 more](https://developer.wordpress.org/reference/functions/trackback_url/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/trackback_url/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/trackback_url/?output_format=md#changelog)󠁿

| Version | Description | 
| [0.71](https://developer.wordpress.org/reference/since/0.71/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/trackback_url/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/trackback_url/?output_format=md#comment-content-3542)
 2.   [Steven Lin](https://profiles.wordpress.org/stevenlinx/)  [  6 years ago  ](https://developer.wordpress.org/reference/functions/trackback_url/#comment-3542)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Ftrackback_url%2F%23comment-3542)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Ftrackback_url%2F%23comment-3542)
 4. Example from the legacy Codex:
 5.     ```php
        <p>Trackback URL for this post: <?php trackback_url(); ?></p>
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Ftrackback_url%2F%3Freplytocom%3D3542%23feedback-editor-3542)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Ftrackback_url%2F)
before being able to contribute a note or feedback.