# Summaries Only in RSS Feeds With a Continue Reading Link

> Sends only a short summary of each post to feed readers, whatever the Reading setting says, and ends it with a link back to the full post on your site.

- Type: PHP
- Runs: Run everywhere
- Category: [RSS Feeds](https://wpide.com/library/category/rss/)
- Tags: rss, feed, excerpt
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/rss-summaries-only/

## Code

```php
// Number of words in each automatic feed summary (posts with a written excerpt use it as is).
$wpide_feed_summary_words = 55;

// Link added after each summary. %s is replaced with the post title. Leave empty for no link.
$wpide_feed_continue_text = 'Continue reading: %s';

// Same as choosing "Excerpt" under Settings > Reading > "For each post in a feed, include".
add_filter( 'pre_option_rss_use_excerpt', function () {
    return '1';
} );

add_filter( 'excerpt_length', function ( $length ) use ( $wpide_feed_summary_words ) {
    return is_feed() ? max( 1, (int) $wpide_feed_summary_words ) : $length;
}, 999 );

add_filter( 'excerpt_more', function ( $more ) {
    return is_feed() ? '&hellip;' : $more;
}, 999 );

add_filter( 'the_excerpt_rss', function ( $excerpt ) use ( $wpide_feed_continue_text ) {
    // The RDF feed prints summaries without CDATA, so it only gets plain text.
    if ( '' === $wpide_feed_continue_text || 'rdf' === get_query_var( 'feed' ) ) {
        return $excerpt;
    }

    $text = sprintf( $wpide_feed_continue_text, wp_strip_all_tags( get_the_title() ) );

    return trim( $excerpt ) . ' <a href="' . esc_url( get_permalink() ) . '">' . esc_html( $text ) . '</a>';
}, 20 );
```

## Notes

Posts with a written excerpt use it in full; others are cut to the word count at the top. Set the link text to an empty string to leave the link out. If the "Read the Full Article" Link in Feeds snippet is also active, items get two links.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Summaries Only in RSS Feeds With a Continue Reading Link" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
