Blog: WordPress
Communication satellite dish

Add Featured Image To RSS Feed In WordPress

Avatar for John Locke

John Locke is a SEO consultant from Sacramento, CA. He helps manufacturing businesses rank higher through his web agency, Lockedown SEO.

Let’s say you have a WordPress site, and the theme adds a Featured Image at the beginning of each post.

Here’s the problem. When you have an RSS feed, or an email campaign hooked into your RSS, that Featured Image doesn’t show up.

This happens because most themes add the Featured Image to posts as part of the WordPress template — that image isn’t natively part of the content.

When you publish those same posts to Facebook, Pinterest, or Twitter, those platforms find the Featured Image, but they use a different protocol — Open Graph — to accomplish this.

So how do we get our Featured Images into our WordPress RSS feed?

Luckily for us, there’s a way to do this, by adding the following code block to our theme’s functions.php file.

 * Add Featured Image to RSS feed

add_filter( 'the_content', 'ld_featured_image_in_feed' );
function ld_featured_image_in_feed( $content ) {
    global $post;
    if( is_feed() ) {
        if ( has_post_thumbnail( $post->ID ) ){
            $feat_image_output = get_the_post_thumbnail( $post->ID, 'full', array( 'style' => 'height: auto;margin-bottom:2em;max-width: 600px !important;padding-top: 0.75em;width: 100% !important;' ) );
            $content = $feat_image_output . $content;
    return $content;

Here’s a video explaining how to implement this code from the WordPress training specialists at

What Is Happening In This Code Snippet

In the code above, we are adding a filter to the page content, running it through the function we are adding, using the global $post variable.

If the page content is in an RSS feed, the function looks for a Featured Image attached to each particular post.

If it finds a Featured Image, it stores it in a variable, along with some inline styles for our RSS email campaigns. We are keeping the image below 600 pixels in width, in order to fit the email templates. (MailChimp uses 600px).

The function then adds the Featured Image before the post content for each blog post in the feed.

What If I Don’t See My Images In My Feed URL?

The URL for your WordPress site RSS feed is usually

If you use the <!--more--> tag in your posts to create a cut-off point for the Read More link, you may only see excerpts of your RSS feed, and may not see images at the traditional URL.

This confused me, too, because I was seeing the full content of my RSS feed in Feedburner, and also in my MailChimp RSS preview.

Feedburner RSS

If you’re using the <!--more--> tag in your RSS feed, go to your feed URL, and Right-click > View Source. You should see the raw markup of your RSS feed, which should include images (and now) your Featured Image.

If you still only see excerpts in your RSS feed and the source code of that feed, log into your WordPress admin area. Go to Settings > Reading.

Reading RSS Settings in WordPress

Find the area that says, For each article in a feed, show — make sure you have this set to Full text, not Summary.

Avatar for John Locke

John Locke is a SEO consultant from Sacramento, CA. He helps manufacturing businesses rank higher through his web agency, Lockedown SEO.

6 comments on “Add Featured Image To RSS Feed In WordPress

  1. This code works great — but we’re wanting only the Featured Image showing up in the feed and not the other images that are in the page. Is there a way to accomplish that?…i.e., excluding images inside the post from the RSS, but still including the featured image in the RSS.

  2. Hi Shelly:

    There’s not an easy way to remove just the content images from your RSS feed while leaving them intact on your blog. But this makes me wonder why you would be compelled to remove the images from the RSS feed at all.

    By chance, are you trying to remove the images from the feed because they are not fitting in the emails themselves. In other words, are the images going off the page?

    If that’s the case, you may want to try the Send Images to RSS plugin. This won’t remove the images from your RSS feed per se, but it will make the images email-friendly. You can also use a custom excerpt to go out to the RSS feed, so in theory, you could put the post in the custom RSS excerpt, just without images.

    I would test this with your particular theme on a staging server first. There is a great tutorial for this plugin on

    Let me know if this gets you closer to your end goal.


    1. Due to ads in our newsletter, our newsletter template is very narrow. We only want one image per story showing up. You have to scroll for eternity when there’s more than one story. We only want the featured image showing up, not images in the post.

  3. Hi Shelley:

    There’s a suggestion in the comment reply above. Did you try that? Using a custom excerpt minus images with the plugin suggested?

    If you try that, and are still unable to accomplish your goal, you may need to hire a developer to help you with your RSS feed. They may need to create a custom RSS feed template to keep images out of your feed. Here’s a place to start:

    On a side note, are the ads an effective monetization strategy? Are they a reliable source of income?


  4. Hi! I know this is a really old post but I am having a hard time with this code. I keeps telling:
    syntax error, unexpected ‘<', expecting end of file
    I don't know what to do about this.

    1. Hi Elena:

      Leave out the last line. This part, erase this ?>.

      That is the closing bracket for the PHP file. So if you have this twice in your functions.php file, that might be what’s throwing the error.


Join the Conversation

Your email address will be kept private. Required fields marked *.