# Add Featured Images to RSS Feeds

> Places the featured image at the top of each item in your RSS feeds, so feed readers and email newsletters show it.

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

## Code

```php
$wpide_feed_image = function ( $content ) {
    $post = get_post();

    if ( $post && has_post_thumbnail( $post ) ) {
        $content = '<p>' . get_the_post_thumbnail( $post, 'large', array( 'style' => 'max-width:100%;height:auto;' ) ) . '</p>' . $content;
    }

    return $content;
};

add_filter( 'the_excerpt_rss', $wpide_feed_image );
add_filter( 'the_content_feed', $wpide_feed_image );
```

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Add Featured Images to RSS Feeds" 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/
