Site logo

Archived topic

Some of my RSS feeds are failing

37 replies · Started by Caro on March 4, 2022

Viewing posts 31–38 of 38

Are there any server caches or CDN on that server ?
If so can you make sure they are disabled.

To add to David's suggestion:

I can definitely see the <img> thumbnail on the /feed of your site. I wonder if pinterest doesn't read <img> on the file.

Perhaps we need to replace <img> with <media:content>

Can you try this?

function featured_image_in_feed( $content ) {
    global $post;
    if( is_feed() ) {
        if ( has_post_thumbnail( $post->ID ) ){
			$outputURL = get_the_post_thumbnail_url( $post->ID, 'full' );
			$output = '<media:content url="'.$outputURL.'"><media:title>'.$post->post_title.'</media:title></media:content>';
            $content = $output . $content;
        }
    }
    return $content;
}
add_filter( 'the_content_feed', 'featured_image_in_feed' );
add_filter( 'the_excerpt_feed', 'featured_image_in_feed' );

I've spoken to my host —— he's not aware of any server caches or CDN on that server.

I'm using Shortpixel to squish my images — could that be causing the issue?

Have added the above code — hopefully that might fix things? :)

I get the feeling its taking a while for your Feed to get updated, which may just economic use of a cURL action .... can you retest with Pinterest and let us know.

Will do!!

Although I explained the situation to my host and he's come up with a cunning theory.

He has said:

' I do have a hunch...

Firstly, there aren't any images within the feed itself, the feed is essentially just an xml file, like an index in a book, detailing where about to find all the goodies (content and images).
This is in fact like a sitemap.xml file that all the search engines love to see....

The feed is made up of lots of entries

An example entry in the feed is something like this.... which describes a block of content.....

<item>
<title>How To Paint a Chest of Drawers in Cottagecore Style</title>
<link>https://thelistedhome.co.uk/how-to-paint-a-chest-of-drawers-in-cottagecore-style/</link&gt;
<comments>https://thelistedhome.co.uk/how-to-paint-a-chest-of-drawers-in-cottagecore-style/#comments</comments&gt;

<dc:creator><![CDATA[Caro Davies]]></dc:creator>
<pubDate>Thu, 06 Jan 2022 17:28:30 +0000</pubDate>
<category><![CDATA[DIY]]></category>
<category><![CDATA[Interiors]]></category>
<category><![CDATA[chalk paint]]></category>
<category><![CDATA[cottagecore]]></category>
<category><![CDATA[shabbychic]]></category>
<category><![CDATA[upcycling]]></category>
<guid isPermaLink="false">https://thelistedhome.co.uk/?p=32696</guid&gt;

<description><![CDATA[<p>Simple, homespun interiors have been in fashion for decades; under different guises. The Cottagecore aesthetic appears — once again — in this year’s top 10 interior trends. And it shows no signs of slowing down or decreasing in popularity. In this post, I’ll show you how to paint a chest of drawers in Cottagecore style. ... </p>
<p class="read-more-container">Read more</p>
<p>The post How To Paint a Chest of Drawers in Cottagecore Style appeared first on The Listed Home.</p>
]]></description>

<wfw:commentRss>https://thelistedhome.co.uk/how-to-paint-a-chest-of-drawers-in-cottagecore-style/feed/</wfw:commentRss&gt;
<slash:comments>2</slash:comments>

</item>

There's an xml element close to the top called <link> which contains a link to the specific page. The interesting hunch which I have is to do with how the page is loaded.

If you go to the link from the example above, just by using a browser (https://thelistedhome.co.uk/how-to-paint-a-chest-of-drawers-in-cottagecore-style/), you'll see that the content is loaded in where you can see it within the viewport (The portion of the site you can see on your monitor (depending on the size of your monitor)), however, as you scroll down the page, the image content appears to be getting lazy-loaded in, and so perhaps doesnt actually exist within the DOM until it comes into view.
You can see this happening if you look at the network tab in developer tools whilst your scrolling down.

So my theory is, essentially, depending on how the pintrest API scrapes the data from the rss feed, it may not actually see any images.

To test said theory, I'd try to turn off the feature that allows for lazy-loading (This may be one of your plugins) and then see if pintrest can scrape the content via the rss feed.'

I think it's a good hunch. But I'll wait a couple of days to see if I get another failed RSS feed email from Pinterest.

If I don't, the added php might have fixed it.

If I do, then I'll try disabling the lazy loading.

Thanks ever so much for all your help on this guys — I'm really grateful :)

You're welcome :)

Just to say — I think we have success!! I haven't had another message from Pinterest!! I'm taking that as a win!!!

Fingers crossed that last code change has solved the issue.

I'll mark it as resolved — unless I hear from them again!!

Thanks so much guys — awesome support as ever. I really appreciate your time and advice :)

Glad to hear that!

This archived topic is closed to new replies.