Why Are Duplicate Images Appearing in My Blog Posts from Third-Party RSS Feeds?

Why Are Duplicate Images Appearing in My Blog Posts from Third-Party RSS Feeds?

Why Are Duplicate Images Appearing in My Blog Posts from Third-Party RSS Feeds?

Who Is This Article For?

  • Clients using the RSS Subscription settings.
  • Clients who notice two images appearing within blog posts imported from third-party feeds.

Why Does This Happen?

You may occasionally see duplicate images in blog posts added via a third-party RSS feed using the RSS Subscription settings. This typically happens because many third-party feeds do not include a featured image. To compensate, the system pulls an image from the blog description to generate a featured image.

However, if the feed already includes a featured image tag, both the featured image and the image from the description can appear in the post, resulting in duplicate images.

How Can I Fix This?

Add the following JavaScript to your Blog Category Custom Header HTML. This script automatically removes any in-article image that matches the featured image, preventing duplicates.

<script>
$(document).ready(function() {
    let featuredImg = $('.content-header .media-container img').attr('src');
    $('article img').each(function() {
        if ($(this).attr('src') == featuredImg) {
            $(this).remove();
        }
    });
});
</script>

After adding this script, your blog posts will display only one instance of the image, ensuring a cleaner and more professional appearance.