Title: the_feed_link
Published: April 25, 2014
Last modified: February 24, 2026

---

# the_feed_link( string $anchor, string $feed )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/the_feed_link/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/the_feed_link/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/the_feed_link/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/the_feed_link/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/the_feed_link/?output_format=md#changelog)

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

Displays the permalink for the feed type.

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

 `$anchor`stringrequired

The link’s anchor text.

`$feed`stringoptional

Feed type. Possible values include `'rss2'`, `'atom'`.
 Default is the value of 
[get_default_feed()](https://developer.wordpress.org/reference/functions/get_default_feed/).

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

    ```php
    function the_feed_link( $anchor, $feed = '' ) {
    	$link = '<a href="' . esc_url( get_feed_link( $feed ) ) . '">' . $anchor . '</a>';

    	/**
    	 * Filters the feed link anchor tag.
    	 *
    	 * @since 3.0.0
    	 *
    	 * @param string $link The complete anchor tag for a feed link.
    	 * @param string $feed The feed type. Possible values include 'rss2', 'atom',
    	 *                     or an empty string for the default feed type.
    	 */
    	echo apply_filters( 'the_feed_link', $link, $feed );
    }
    ```

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

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/the_feed_link/?output_format=md#hooks)󠁿

 [apply_filters( ‘the_feed_link’, string $link, string $feed )](https://developer.wordpress.org/reference/hooks/the_feed_link/)

Filters the feed link anchor tag.

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

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

Retrieves the permalink for the feed type.

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

Checks and cleans a URL.

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

Calls the callback functions that have been added to a filter hook.

  |

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

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

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

## User Contributed Notes

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