Skip to main content
Login Join
Snippet · PHP

Automatically Add Featured Image to RSS Feed

Shared by Amit Dholiya · July 13, 2026

15 views
Back to Snippets

Show the featured image at the top of RSS feed content.

Steps

  1. Open functions.php.
  2. Add the code below.
  3. Save the file.

Done — RSS readers will display featured images.

function rss_featured_image($content) {
    global $post;

    if (has_post_thumbnail($post->ID)) {
        $content = get_the_post_thumbnail($post->ID, 'full') . $content;
    }

    return $content;
}
add_filter('the_excerpt_rss', 'rss_featured_image');
add_filter('the_content_feed', 'rss_featured_image');
Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

0 comments