WordPress the_title_rss() Function

Beginner
6 min read
Updated: Nov 2026
3 examples
Prints a feed title

Definition

In WordPress, the_title_rss() prints the title of the current post for a feed. It is used inside the title tag of an RSS item.

It removes HTML tags and makes the text safe for XML.

Syntax

A few ways to call the_title_rss().

WordPress
<title><?php the_title_rss(); ?></title>
CallWhat it does
the_title_rss()Print the title for a feed.
get_the_title_rss()Return the feed title as a string.
the_title()The same idea for normal pages.

It prints the title and takes no arguments. Use it only in feed templates.

Full declaration
WordPress
the_title_rss(): void

Parameters

ParameterDescription
(none)This function takes no parameters.

Return Value

Return ValueDescription
voidNothing is returned. The title is printed.

WordPress Examples

Three short examples. Each one shows the code and what it prints.

Example 1 — Title in a feed item

Use it for the title of each item.

WordPress
<item>
  <title><?php the_title_rss(); ?></title>
  <link><?php the_permalink_rss(); ?></link>
</item>

How It Works

  1. the_title_rss() prints the title for the feed item.
  2. the_permalink_rss() prints the link.
  3. Together they form one feed item.

Example 2 — Tags are removed

If a title has HTML, the feed version removes it.

WordPress
<title><?php the_title_rss(); ?></title>

How It Works

  1. The saved title may have been Hello <em>World</em>.
  2. The feed version strips the tags.
  3. Feed readers get plain text.

Example 3 — Return the title

Use get_the_title_rss() to store it.

WordPress
<?php
$title = get_the_title_rss();
echo '<title>' . $title . '</title>';

How It Works

  1. get_the_title_rss() returns the feed title.
  2. You can check or change it first.
  3. Here we print it inside a title tag.

Frequently Asked Questions

It prints the post title for an RSS feed, with tags removed and XML safe.
Inside the title tag of an item in a feed template.
No.
Use get_the_title_rss().
Use the_title().

Browse all post functions

Open the functions index for simple guides with examples and FAQs.

Post Functions Index →

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.

15 people found this page helpful