
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().
<title><?php the_title_rss(); ?></title>
| Call | What 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
Parameters
| Parameter | Description |
|---|
(none) | This function takes no parameters. |
Return Value
| Return Value | Description |
|---|
| void | Nothing 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.
<item>
<title><?php the_title_rss(); ?></title>
<link><?php the_permalink_rss(); ?></link>
</item>
<item>
<title>Hello World</title>
<link>https://example.com/hello-world/</link>
</item>
How It Works
the_title_rss() prints the title for the feed item.the_permalink_rss() prints the link.- Together they form one feed item.
Example 2 — Tags are removed
If a title has HTML, the feed version removes it.
<title><?php the_title_rss(); ?></title>
How It Works
- The saved title may have been
Hello <em>World</em>. - The feed version strips the tags.
- Feed readers get plain text.
Example 3 — Return the title
Use get_the_title_rss() to store it.
<?php
$title = get_the_title_rss();
echo '<title>' . $title . '</title>';
<title>Hello World</title>
How It Works
get_the_title_rss() returns the feed title.- You can check or change it first.
- 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
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.
15 people found this page helpful