Mailchimp 3 min read

Adding WP Featured Image To Mailchimp RSS Campaign

Adding WP Featured Image To Mailchimp RSS Campaign

Originally written by Ari Krzyzek for Chykalophia.

Update (October 2026): Mailchimp still documents the *|RSSITEM:IMAGE|* and *|FEEDITEM:IMAGE|* merge tags; they show the image from a <media:content> element in your feed, in certain feed setups (see Mailchimp's RSS merge tags and FEED merge tags pages). However, the PHP feed template in this post is incomplete in this copy (its XML tags are missing), so don't copy it as-is. The linked Yoast and Mailchimp knowledge-base articles have also moved or been removed.

Sending out newsletter email to your client or your blog readers is one of the best approach to keep them into your inner circle. But sometimes, it took a while to prepare the content for your upcoming campaign or a special newsletter for them. There's a simpler way: blog post! Yup, a simple blog post can do the trick. It really depends on what kind of information or offer you have on your blog post, nevertheless setting them into RSS newsletter campaign will save you time in preparing the newsletter campaign for your readers. Of course if you want to send them something exclusive and not the blog post, then this is definitely not your option. In this post I'm not going to describe or guide you on how to set the RSS campaign for your blog post, especially if you're using Mailchimp. Although, you can actually find more info and the guide on how to do that over here. Instead, I'm going to guide you on how to add the Wordpress featured image to Mailchimp RSS to email campaign. I originally created my RSS to email campaign with proper Mailchimp tag, but apparently my featured image from the Wordpress blog post keep missing. So I've looked through some of the resources and other blog post related to this problem. It's a bit scattered around, so I thought having the solution in one place would help others with the same problem. As mentioned on the Mailchimp support about "How can I format the image content in my RSS to email campaigns?", it is best to create a new custom RSS feed just for Mailchimp RSS campaign. So let's start by creating a custom RSS feed. If you're not so proficient with web development then this article will help. It shows how to create a custom RSS feed and that's what we're going to use for this RSS campaign. Your RSS feed template should be like this: /* Template Name: Custom Feed */ $numposts = 5; function yoast_rss_date( $timestamp = null ) { $timestamp = ($timestamp==null) ? time() : $timestamp; echo date(DATE_RSS, $timestamp); } function yoast_rss_text_limit($string, $length, $replacer = '...') { $string = strip_tags($string); if(strlen($string) > $length) return (preg_match('/^(.*)W.*$/', substr($string, 0, $length+1), $matches) ? $matches[1] : substr($string, 0, $length)) . $replacer; return $string; } $posts = query_posts('showposts='.$numposts); $lastpost = $numposts - 1; header("Content-Type: application/rss+xml; charset=UTF-8"); echo ''; ?> http://YOURWEB.com/ The latest blog posts from YOURWEB.com. en-us   post_date_gmt) ); ?> post_date_gmt) ); ?> [email protected]     ID); ?> post_content, 500).' Keep on reading: '.get_the_title($post->ID).''.']]>';  ?>   post_date_gmt) ); ?> ID); ?>   In order to be able to pull the Wordpress featured image, we're going to add: So, your final PHP file will be like this: /* Template Name: Custom Feed */ $numposts = 5; function yoast_rss_date( $timestamp = null ) { $timestamp = ($timestamp==null) ? time() : $timestamp; echo date(DATE_RSS, $timestamp); } function yoast_rss_text_limit($string, $length, $replacer = '...') { $string = strip_tags($string); if(strlen($string) > $length) return (preg_match('/^(.*)W.*$/', substr($string, 0, $length+1), $matches) ? $matches[1] : substr($string, 0, $length)) . $replacer; return $string; } $posts = query_posts('showposts='.$numposts); $lastpost = $numposts - 1; header("Content-Type: application/rss+xml; charset=UTF-8"); echo ''; ?> http://YOURWEB.com/ The latest blog posts from YOURWEB.com. en-us   post_date_gmt) ); ?> post_date_gmt) ); ?> [email protected]     ID); ?> post_content, 500).' Keep on reading: '.get_the_title($post->ID).''.']]>';  ?>   post_date_gmt) ); ?> ID); ?>   Once you uploaded the PHP template file above to your Wordpress theme folder, follow the instructions as mentioned on the Yoast blog post, which are:

  • Create a new page (which can be blank), with a secret URL,
  • Use your newly created “Custom Feed” template for that page,
  • Open the secret URL in your browser and now you should have a custom RSS feed for the Mailchimp RSS campaign.

Next step, you should replace the RSS feed address (refer to the custom RSS URL page you just created) where your your Mailchimp RSS campaign is reading from. And make sure to also include the Mailchimp merge tag *|RSSITEM:IMAGE|* or *|FEEDITEM:IMAGE|* Here's the sample of my RSS email newsletter based on this mini tutorial. Credit: Original resource for the featured image code.

Get the next one by email

One practical fix every two weeks for owners of established B2B companies. Websites, conversions and operations, written plainly.

Peter Krzyzek

eter Krzyzek is co-founder and CTO of Chykalophia, the Chicago agency that builds strategy-led websites for established B2B companies, and co-author of Made to Sell.

Comments

Read next

Keep going

All articles →

One practical fix, every two weeks

For owners who'd rather fix the leak than buy more traffic.