the_permalink_rss()

Display the permalink to the post for use in feeds.


Source Source

File: wp-includes/feed.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() ) );
}


Top ↑

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by James White

    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.

    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';
    };

You must log in before being able to contribute a note or feedback.