We’ve already gone through how to get featured images/blog post images to show in MailChimp with the Featured Image in RSS plugin, but perhaps you don’t want to use a plugin. Maybe you’re looking for a way to edit your RSS feed without putting yet another plugin into your WordPress install. Never fear! We can help guide you through this plugin-less route. It’s actually quite simple, and there’s a few different ways to do it. Let’s take a look!

Method 1: Hook into rss2_item

This will be easiest and will likely be the best solution for most users who do not need custom feeds! Simply add this to your theme’s functions.php (and make sure to change the size of the ‘thumbnail’ to whatever is declared in your theme; not sure what this is or means? Read about WordPress image sizes here!) and your /feed should be updated as well!

Method 2: Custom Template

What we are going to do is create a custom page template that acts as our modified RSS feed. This is also a great way you can modify your RSS feed to serve only certain content, such as if you have more than one feed going at the same time.

Step 1: Create a new page template

This will reside inside of your WordPress theme’s folder. Much like header.php or footer.php, it will act similarly. If you’ve already made page templates before, you’ll know all of the required information, but we’re going to outline it for all of our first timers.

I am going to name the filename of my page template mailchimp.php. It doesn’t really matter what you name it, but you should make sure to use something that you won’t use in the future or won’t conflict with WordPress. That means probably refrain from using page.php, index.php, archives.php, etc. If you want to be ultra sure, you can also name the file name “rss-mailchimp.php” or otherwise.

Step 2: Add the required information at the top of the page document

Basically this tells WordPress that this file is a template, so it will be selectable on the right sidebar of your pages when you go to make it. Add this at the top:

Again, you can change the “template name” to anything you want, but I am going to name mine simply “MailChimp”

Step 3: Define your RSS items in your page template

You can copy this code to paste into your file after the code from step 2 and it will “just work”, but I will explain some of the items worth looking at to make sure that you have it just the way you want to.

Explanation of items of interest: $numposts is the number of posts in this feed. You can change it depending on what you’re doing with your feed. $posts, if you change the number on &cat=-1, can make it so your feed only serves posts made to a certain category. For example, if my category “advertising” is category ID 3, and I only wanted to send emails in the advertising category, I would change it to &cat=3

Important thing you need that is not in the standard RSS feed: You’ll notice under RSS version type there is an additional line: xmlns:media=”http://search.yahoo.com/mrss/” MailChimp uses media content blocks to read images, so you will need to first define that you are using this sort of markup with this line. I have then added after the category block 

Which basically says “if there is a featured image, get the URL for the full size of this featured image”, and then after that says “here is image media, here is the URL of it”, which is what MailChimp will then use to pull the image. You may want to define  a width parameter here if you are using the ‘full’ size featured images like I am, so you don’t end up making anyone’s inbox explode! Remember to always preview your campaigns before hitting send.

Step 4A: Make a page that uses this page template

Go into WordPress and click pages, then click add new. You will want to use the page attributes selector to pick your new “mailchimp” (or other name) template. Give your page a desired page slug (I am using /mailchimp, but you might want to use something else), and hit publish. You may also want to noindex this page as well.

Page Attributes in WordPress

If you don’t see “page attributes”, scroll to the top of the page and click “screen options”, then make sure “page attributes” is checked off. It should show now.

Screen Options

Step 4B: A Different method of adding your template…

Don’t want your template to take up space on your front end somewhere? Never fear! Let’s append it to /feed and keep all our RSS items in one spot. Add this code to functions.php:

In the above code, it will be looking for a file titled “rss-mailchimp.php”, but if you’ve just named it “mailchimp.php”, that’s OK too, just remove ‘rss’ from the array like so:


Before you can use your new url, you’ll want to flush your rewrite rules… Head on over to Settings -> Permalinks in WordPress and just hit save without changing anything. That should do it!

Step 5: Load your new URL into MailChimp

Instead of using /feed or /rss in your campaign setup, you’ll now want to use the URL you defined in step 4A. Mine will be http://www.website.com/mailchimp

For step 4B, your url will be http://www.website.com/feed/mailchimp

Step 6: Use the *|RSSITEM:IMAGE|* tag

This doesn’t work out of the box with WordPress and MailChimp, but it should be working now! Just place that merge tag where you want your image to appear, and when you test it, you should now see your featured images showing. Hooray!

Have questions or comments? Let us know below!

Want to get updates like this delivered straight to your inbox?
Subscribe to our blog to receive website design tips, development tricks, the latest in SEO, and more. We don't share your email address with anyone and you can unsubscribe at any time.

9 responses to “How to Show WordPress Featured Images in MailChimp RSS – Without a Plugin”

  1. sarah says:

    This works perfectly!
    Thanks 😀

  2. Eli says:

    Hi, I tried method one and can’t get it to work. I had also tried the plugin route you recommended and the image won’t display despite having followed all the instructions/recommendations on the plugin’s support page.

    For method one, i put in the additional code to the functions page but didn’t understand what you meant about “make sure to change the size of the ‘thumbnail’ to whatever is declared in your theme”. Where would it be declared, and what would need to be changed about the code?

    • Hi Eli,

      Can you give me a little more information about what you’re experiencing?

      For method one, “make sure to change the size of the ‘thumbnail’ to whatever is declared in your theme” refers to the size image you want to use. When you install the code provided in your functions.php, you want to look at this line:

      $thumbnail = wp_get_attachment_image_src( $thumbnail_ID, 'thumbnail' );

      Where it says ‘thumbnail’ is where you would substitute the size you want. By default, WordPress has sizes thumbnail (150×150), medium (300 max x 300 max), large (1024 max by 1024 max), and full (the original dimensions of the upload). Thumbnail will often be too small, so you may want to go with medium or large, which means the code will then look like:

      $thumbnail = wp_get_attachment_image_src( $thumbnail_ID, 'large' );

  3. Professional says:

    @Aimee though its easy to understand for most, but you really ought to change
    $thumbnail = wp_get_attachment_image_src( $thumbnail_ID, ‘thumbnail’ );
    $thumbnail = wp_get_attachment_image_src( $thumbnail_ID, ‘thumbnail_size’ );

    for some people.

    • Hi there,

      That wouldn’t make sense. “Thumbnail” is an actual size recognized by WordPress. “Thumbnail_size” is not a size recognized by WordPress. The code works out-of-the-box if you copy paste it. I won’t be modifying it.

  4. ikukids says:

    Hi there,
    Method 1 works like a charm for me (I used ‘medium’ for thumbnail size). Thanks a lot !!! I’m looking fort a way to add a radius corner to all the thumbnails. Any idea ?

    • Glad it worked for you!

      As for the radius corner, you’d have to add that to the MailChimp mailer itself. I’m not sure if all email clients will support border-radius, but I imagine you’d need to do one of the following:

      • Put the image merge tag inside a div, style the div inline
      • Put the image merge tag inside a div, use a global style at the beginning of the mailer to target the img within that div
      • Place the style in the media:content tag?? (I’m not sure this will even work at all, it’s a theory you could try)

      Let me know how you make out!

  5. arnav says:

    I want to show a default image when there is no featured image is added to the post.
    is it possible?

    • Hey there! You’d probably want to work on an if/else statement that says if there is an image set, use that image, else use the default image.

      I have not tested this, but it would probably look like:

Leave a Reply

Your email address will not be published. Required fields are marked *