WordPress the_excerpt_rss() Function

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

Definition

In WordPress, the_excerpt_rss() prints the post excerpt for a feed. It is used inside the description tag of an RSS item.

It gives plain text that is safe to place inside an XML feed.

Syntax

A few ways to call the_excerpt_rss().

WordPress
<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
CallWhat it does
the_excerpt_rss()Print the feed excerpt.
the_excerpt()The same idea for normal pages.

It prints the excerpt and takes no arguments. Use it only in a feed template.

Full declaration
WordPress
the_excerpt_rss(): void

Parameters

ParameterDescription
(none)This function takes no parameters.

Return Value

Return ValueDescription
voidNothing is returned. The excerpt is printed.

WordPress Examples

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

Example 1 — Excerpt in a feed item

Use it as the description of an item.

WordPress
<item>
  <title><?php the_title_rss(); ?></title>
  <description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>
</item>

How It Works

  1. the_title_rss() prints the item title.
  2. the_excerpt_rss() prints the excerpt.
  3. CDATA lets the text hold special characters safely.

Example 2 — A hand written excerpt

If you wrote an excerpt in the editor, it is used.

WordPress
<description><![CDATA[<?php the_excerpt_rss(); ?>]]></description>

How It Works

  1. The Excerpt box of the editor has a custom summary.
  2. the_excerpt_rss() prints that text.
  3. No automatic cut is needed.

Example 3 — Excerpt for a normal page

On a normal page use the_excerpt(). It adds a paragraph tag.

WordPress
<?php the_excerpt(); ?>

How It Works

  1. the_excerpt() is for pages visitors see.
  2. It wraps the text in a p tag.
  3. the_excerpt_rss() is for feeds.

Frequently Asked Questions

It prints the excerpt of the current post for an RSS feed.
Inside the description tag of an item in a feed template.
No.
the_excerpt() is for web pages. the_excerpt_rss() is for XML feeds.
Yes. It works on the current post.

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.

12 people found this page helpful