WordPress comment_author_rss() Function

Beginner
4 min read
Updated: Nov 2026
3 examples
Template tag

Definition

In WordPress, comment_author_rss() prints the comment author name in a format that is safe for an RSS feed.

It prints the name. It is used in feed templates, such as the comments feed, not in normal theme pages.

Syntax

It takes no arguments. Call it inside the loop of a comments feed.

WordPress
comment_author_rss();
CallWhat it does
comment_author_rss()Prints the name of the current comment author for a feed.
get_comment_author_rss()Returns the same name as a string.
comment_author()Use this one in normal theme pages.

The name is filtered so it works inside XML.

Full declaration
WordPress
comment_author_rss(): void

Parameters

ParameterDescription
NoneThis function has no parameters. It uses the current comment.

Return Value

Return ValueDescription
voidNothing is returned. The function prints the author name.

WordPress Examples

Three short theme examples. Each one has a sample output.

Example 1 — In a feed item

Print the author inside a custom comments feed item.

WordPress
<item>
  <dc:creator><![CDATA[<?php comment_author_rss(); ?>]]></dc:creator>
</item>

How It Works

  1. A feed item is made for each comment.
  2. comment_author_rss() prints the name.
  3. CDATA keeps special characters safe in XML.

Example 2 — In a feed title

Use the name in the title of a feed item.

WordPress
<title>Comment by <?php comment_author_rss(); ?></title>

How It Works

  1. The title text is built in your feed template.
  2. The name comes from the current comment.
  3. The output is plain text.

Example 3 — Return value

Use get_comment_author_rss() when you need a string.

WordPress
<?php $author = get_comment_author_rss(); ?>
<author><?php echo esc_html( $author ); ?></author>

How It Works

  1. get_comment_author_rss() returns the name.
  2. esc_html() keeps the XML valid.
  3. Use this when you build the tag yourself.

Frequently Asked Questions

It prints the name of the current comment author in a form that is safe for RSS.
In feed templates, such as a custom comments feed.
Both print the name. The RSS version is filtered for feeds.
No. It always uses the current comment.
Use get_comment_author_rss().

Next: comment_author_url()

Print the website address entered by the comment author.

comment_author_url() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

14 people found this page helpful