Posted on 20 January, 2010 By Kim Woodbridge 3 Comments

The WordPress Fetch Feed Function and the Feed Cache

 
Share

~Feeding the boardwalk cats~ (by ~Sage~)

A couple of days ago I wrote about how to use a RSS feed with the WordPress fetch feed function.

I was excited about figuring this out because I could place the feed wherever I wanted and didn’t have to worry about using a plugin.

I set it up in the evening and bookmarked a new page that should have updated the feed the following morning. Later in the day I noticed the feed hadn’t updated with the new bookmark so I started to worry that I hadn’t set it up properly or that it wasn’t going to be a workable solution.

So, I started to search and ask how often the fetch feed function pulls in the new feeds. I could not, however, find an answer to my question. That’s because I was asking the wrong question. The WordPress feed cache is what determines how often the feed is pulled in. In my search for answers I finally found this article by WP Engineer – Feed Cache in WordPress.

The article explains that by default the feed cache checks for updates to the feed every 12 hours. This is why me feed hadn’t updated. I had added the code almost 24 hours earlier but it hadn’t been 12 hours since I added the most recent bookmark to be pulled in.

The article also lists different ways to increase how often the field is pulled. I used the following code and added it to my functions file, functions.php:

<?php
add_filter( 'wp_feed_cache_transient_lifetime',
create_function( '$a', 'return 1800;' ) ); ?>

wp_feed_cache_transient_lifetime is a hook that works with the fetch feed function and can set how often the feed is checked for updates. The number 1800 refers to seconds, so in this example it is checking every 30 minutes. It probably doesn’t need to be this often – maybe something between 30 minutes and 12 hours ;-)

As WP Engineer mentions, this hook can be used in a function or in a plugin and can also be used with conditionals so that the feed is only checked and updated when specific pages are loaded.

So, mystery solved as to why my feed wasn’t being updated and I learned a little but more about WordPress that I intended when I first started playing with the fetch feed function.

photo credit: ~Sage~


Related Posts:
  • How to Add a RSS Feed Without a Plugin Using the WordPress Fetch Feed Function
  • How to Add the Post Thumbnail Feature to your WordPress Installation
  • (Anti) Social Lists 1/10/10
  • (Anti) Social-Lists 10/18/09
  • How to Remove “Says” From WordPress 2.7 Threaded Comments
  • Posted In : WordPress Tips
    If you enjoyed this post, please subscribe to my RSS Feed. You can also connect with my Facebook page or follow me on Twitter.



    3 Responses to “The WordPress Fetch Feed Function and the Feed Cache”


    • What would make your feed suddenly stop working? It has been a month now that my feed no longer works. I had changed nothing just had a reader email me that my feed didn’t work, I have tried to figure out why to no avail. It aggravated me so much I finally gave up. (plus have been super busy over the last month trying to find a new place to live I have barely even posted) but I don’t want to loose the people that are subscribed.

      Feeds seem to be the thing I have the most trouble with. It took me forever to get it to work the first time. I had tried using feedburner and it worked for awhile and quit so I got rid of it and things were going great for several months then poof! gone again.


    • Hi Julie – Did anything else change around the same time? For example, was WordPress upgraded or was a new plugin installed? Are you using the Feedburner plugin to redirect the feed?

      Also, the link for the RSS subscribe image is incorrect – it says
      http://lifedomestic.com/www.lifedomestic.com/feed/rss – that needs to be fixed.

      When I try variations such as lifedomestic.com/feed a blank RSS page comes up – this leads me to believe that it’s a plugin causing the problem. You could try deactivating all plugins and then testing.

      Unfortunately, this article is unrelated to this issue – this article is about adding a feed to your page templates like the WordPress bookmarks one I have in the footer.


    • I may come to you when I get to that project i hinted to on the last post. ;)
      Dennis Edell´s last blog ..Blog Move Is Imminent ! I’m Looking For Launch Partners… My ComLuv Profile


    Leave a Comment
    You may use: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .

    CommentLuv Enabled

    Recent Comments

      • Ari Herzog: Agreed on the updates/inbox snafu. I rarely see page updates and I know where they are! .-= Ari Herzog´s last blog .....
      • jayson: Kim, Love the themes. I am looking to update the theme on my site to something more appropriate. My site is all abou...
      • vered: "I wish more people would use this. I think it’s silly when I get updates for things occuring in Kansas and California –...
      • Dennis Edell @ Direct Sales Marketing: I was speaking generally, not specifically this month. how exactly do you work things? .-= Dennis Edell @ Direct Sales M...
      • Lucy Beer: Unfortunately I think next to no-one actually sees those "Updates". They're buried in a subsection of the inbox and I do...
      • Kim Woodbridge: Hi Marbella - Thanks! I had a great time....
      • Kim Woodbridge: Hi Julie - I'll probably try kayaking again next summer but I don't know if I will become much of a kayaker - I had a di...
      • Kim Woodbridge: Hi Vered - If you ever get the chance, you should go. It's like a different world - it's so quiet and peaceful....

    About

    Kim Woodbridge is an accomplished Information and Technical Consultant specializing in the entire implementation of a WordPress based website including installation, theme design, upgrades, unique customizations and ongoing site maintenance.

    Wordpress Services

    • Installation, upgrades and maintenance
    • Conversion of existing html and css templates
    • Theme and plugin recommendations
    • CSS customizations
    • Troubleshooting and tweaks for unique situations
    • Customization for individual blogging goals and needs
    • Training and advice