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 that are imported from third-party feeds.

Why Does This Happen?

Occasionally, you may see duplicate images in blog posts that have been added via a third-party RSS feed using the RSS Subscription system. This usually occurs because most third-party feeds do not provide a featured image. As a result, 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 may appear in the post, resulting in duplicate images.

How Can I Fix This?

If you encounter this issue, you can resolve it by adding the following JavaScript code to your Blog Category Custom Header HTML. This script will automatically remove duplicate images that match the featured image.

<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>

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