How to Enable Featured Images in WordPress RSS Feed for MailChimp

>How to Enable Featured Images in WordPress RSS Feed for MailChimp
  • enable featured images in wordpress rss feed

For a long period of time, I’ve been using MailPoet to send my newsletters, mainly because it was easy to set up, I could handle it from my WordPress dashboard, and it was easy to automatically send newsletters with my latest posts.

Of course, it’s not ideal to send newsletters using WordPress, especially if your environment is not properly optimized, but it worked just fine for me, and I was happy with it.

But, I decided to step up my game in order to offer my subscribers a better experience and to further comply with the GDPR law.

Therefore, I decided to use MailChimp, a very well-known email marketing service.

Fortunately, MailChimp lets you send your latest posts automatically by using your WordPress RSS feed, but the feed doesn’t contain your posts’ featured images and that kind of sucks.

Just sending simple links to your posts in your newsletter, or links with text, won’t look that good.

Luckily, you can enable your featured images in your WordPress RSS feed, and there are two ways to do it: via code or plugin.

Enable featured images in WordPress RSS feed via code

I recommend using this method if it works. The fewer plugins you have, the better!

For me, it didn’t work 🙁 , and I don’t know why, and I didn’t spend much time looking into it either. It’s probably a conflict with the theme.

So, to enable your featured images in your WordPress RSS feed via code, you’ll have to do the following:

Step 1Access your WordPress website’s files.

Step 2 – Find your theme’s functions.php file and edit it.

I recommend having a child theme in place, otherwise, the changes will go away with the next theme update. I also recommend backing up the file or the whole website before making changes!

You can normally find the functions.php file in public_html/wp-content/themes/YourThemeName-child/functions.php or public_html/YourDomain.com/wp-content/themes/YourThemeName-child/functions.php for an add-on domain.

edit WordPress functions.php cpanel

Editing functions.php via cPanel

Step 3 – Add the below code at the very bottom of the file or right before ?> (if it exists).

function featured_images_RSS($content) {
global $post;
if ( has_post_thumbnail( $post->ID ) ){
$content = '<p>' . get_the_post_thumbnail( $post->ID, 'large', array( 'style' => 'margin-bottom: 20px;' )) . '</p>' . $content;
}
return $content;
}
add_filter('the_excerpt_rss', 'featured_images_RSS');
add_filter('the_content_feed', 'featured_images_RSS');

enable featured images WordPress RSS feed functions.php

View from the functions.php file in cPanel

Step 4 – Update/Save the file.

Step 5 – Clear your website and browser cache.

If you think the images are too big, change large with medium or thumbnail in the code.

You can also change the bottom margin by adding another value, such as 10px or 15px.

If your featured images don’t appear in your WordPress RSS feed, then you’ll have to use a plugin, as I had to do.

Enable featured images in WordPress RSS feed via plugin

The plugin we’ll use is called Featured Images in RSS & Mailchimp Email.

After you install the plugin, you’ll notice that it has very few and simple settings, which you can access by clicking on Featured Images in RSS Feeds in your Dashboard’s sidebar.

featured images rss feed mailchimp plugin

Simply choose the size and alignment of the images, and set the spacing between text and RSS feed images.

I’ve also made a video for you:

Here’s how the WordPress RSS feed will look like with the featured images enabled in it:

featured images enabled in WordPress RSS feed

It seems that, on Firefox, the text goes to the right of the image, but I don’t know why, and I didn’t give it much thought either.

I tested it with a default theme and disabled plugins, but still no change, so it has something to do with the browser, or the plugin itself, or both.

On Chrome, it shows fine, but to properly view your WordPress RSS feed on Chrome, you’ll need to install this extension, otherwise, it will display just code.

Anyway, it will ok in the MailChimp newsletter and that’s the important part.

For those of you who use Yoast SEO

If you’re using the Yoast SEO plugin – everyone should use it since it’s an essential WordPress plugin – you’ll notice something like this after the post excerpt in your RSS feed:

‘The post Your Post’s Title appeared first on Your Site’s Name‘.

WordPress RSS feed Yoast text

This is enabled by default, and while it’s useful if your content gets scraped, it will look very weird in your latest posts newsletter, because MailChimp will “grab” that too.

So, in order to remove that text from the RSS feed, go to SEO -> Search Appearance -> RSS, delete it and press the Save Changes button.

yoast rss feed text

That’s a wrap

Hope you successfully enabled the featured images in your WordPress RSS feed in order to display them in your MailChimp newsletter.

Don’t forget to share the post to help out others!

You can quickly subscribe to my newsletter by using this link.

If you have any questions or thoughts, drop a comment or send a message via contact or Facebook page.

You can also hit the follow button on Twitter and subscribe to the YouTube channel.

If you want to start your own WordPress blog, or need a website for your business, ThemeSkills’ WordPress installation service is at your disposal! On-going WordPress support and maintenance are on the menu as well!

By |2018-09-11T10:18:02+00:00August 20th, 2018|Plugins, WordPress|0 Comments

Leave A Comment

WP ENGINE OFFER!

20% OFF + 4 months FREE on WordPress hosting
Offer expires on 11/30/2018
To celebrate the release of the Gutenberg editor, WP Engine is offering:
  • 20% OFF the first payment on their shared WordPress hosting plans;
  • 4 months FREE on any annual subscription.

And there's more! Since WP Engine bought StudioPress, all their customers get FREE access to the StudioPress themes, including the Genesis Framework!
 
Disclosure: If you make a purchase using this affiliate link, I might receive a commission from WP Engine, at no additional cost to you! Thank you!
close-link