Title: the_permalink_rss
Published: April 25, 2014
Last modified: April 28, 2025

---

# the_permalink_rss()

## In this article

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

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

Displays the permalink to the post for use in feeds.

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

    ```php
    function the_permalink_rss() {
    	/**
    	 * Filters the permalink to the post for use in feeds.
    	 *
    	 * @since 2.3.0
    	 *
    	 * @param string $post_permalink The current post permalink.
    	 */
    	echo esc_url( apply_filters( 'the_permalink_rss', get_permalink() ) );
    }
    ```

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

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

 [apply_filters( ‘the_permalink_rss’, string $post_permalink )](https://developer.wordpress.org/reference/hooks/the_permalink_rss/)

Filters the permalink to the post for use in feeds.

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

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

Checks and cleans a URL.

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

Retrieves the full permalink for the current post or post ID.

  | 
| [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_permalink_rss/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/the_permalink_rss/?output_format=md#)

| Used by | Description | 
| [export_wp()](https://developer.wordpress.org/reference/functions/export_wp/)`wp-admin/includes/export.php` |

Generates the WXR export file for download.

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

Print the permalink to the RSS feed.

  |

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

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

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

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/the_permalink_rss/?output_format=md#comment-content-2239)
 2.   [James White](https://profiles.wordpress.org/jamesfacts/)  [  9 years ago  ](https://developer.wordpress.org/reference/functions/the_permalink_rss/#comment-2239)
 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%2Fthe_permalink_rss%2F%23comment-2239)
    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%2Fthe_permalink_rss%2F%23comment-2239)
 4. **Add Google Analytics campaign tracking to RSS permalinks **
     The following example
    appends GA query variables to permalinks, to track clicks from a site’s RSS feed
    to the site itself.
 5.     ```php
        add_filter('the_permalink_rss', 'rss_campaign_tracking');
    
        function rss_campaign_tracking($post_permalink) {
            return $post_permalink . '?utm_source=rss-feed&utm_medium=rss&utm_campaign=feed';
        };
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_permalink_rss%2F%3Freplytocom%3D2239%23feedback-editor-2239)

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