Home WordPress Comment Functions permalink_comments_rss() Definition permalink_comments_rss() is an old template tag that was used in comments feed templates to print a link for the post. It is not part of current WordPress core.
Today you use comments_link_feed() in a feed, or post_comments_feed_link() on a normal page. This page shows how to stay safe with old themes and what to use instead.
Syntax If an old theme still calls it, guard the call. For new code, use the modern functions.
if ( function_exists( 'permalink_comments_rss' ) ) {
permalink_comments_rss();
}
comments_link_feed();
post_comments_feed_link( 'Comments RSS' ); Call What it does permalink_comments_rss()Old tag. Not available in current WordPress. Check with function_exists() first. comments_link_feed()Prints the comments link of the current post inside a feed. post_comments_feed_link( 'Comments RSS' )Prints a link to the comments feed of the current post.
get_post_comments_feed_link() returns the URL of the comments feed as a string.
Full declaration permalink_comments_rss(): void // legacy tag, not in current WordPress core Parameters Parameter Description None The old tag had no parameters. Its modern replacements are listed in the table above.
Return Value Return Value Description void The old tag printed a URL. If it does not exist on your site, calling it causes a fatal error.
WordPress Examples Three short theme examples. Each one has a sample output.
1. Safe call 2. In a comments feed 3. Comments RSS link Example 1 — Safe call Call an old tag only if it exists.
<?php
if ( function_exists( 'permalink_comments_rss' ) ) {
permalink_comments_rss();
}
?> <!-- Prints nothing on current WordPress because the function does not exist. --> How It Works function_exists() checks that the function is defined.On current WordPress the check is false. No error happens and the page keeps working. Example 2 — In a comments feed Use comments_link_feed() in a feed item.
<item>
<link><?php comments_link_feed(); ?></link>
</item> <item>
<link>https://example.com/hello-world/#comments</link>
</item> How It Works comments_link_feed() prints an XML-safe URL.It points to the comments of the current post. Use it only in feed templates. Example 3 — Comments RSS link Show a link to the comments feed on a single post.
<?php post_comments_feed_link( 'Comments RSS' ); ?> <a href="https://example.com/hello-world/feed/">Comments RSS</a> How It Works post_comments_feed_link() prints a full link.The text is the first argument. Use get_post_comments_feed_link() to get only the URL. Frequently Asked Questions Is permalink_comments_rss() still in WordPress? No. It is an old tag that is not in current WordPress core. Use the modern functions.
What should I use instead in a feed? Use comments_link_feed() inside a feed template.
How do I show a link to the comments RSS feed? Use post_comments_feed_link() on a single post.
How do I get the feed URL as a string? Use get_post_comments_feed_link().
How do I stop errors from old themes? Wrap the call in function_exists(), or replace it with a modern function.
About the author Developer, cloud engineer, and technical writer
I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.
11 people found this page helpful
Helpful Share Copy link Suggestion