Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

How to Alter the WordPress RSS Widget’s Refresh Rate

Last updated on by
Follow WPBeginner on YouTube
How to Alter the WordPress RSS Widget’s Refresh Rate

As amazing as the built in WordPress RSS widget can be there are times that it just doesn’t update fast enough. Thanks to the fact that WordPress is so easy to customize we can easily change this. In this article, we will show you how to alter the WordPress RSS Widget’s refresh rate.

All you have to do is add the following code to your theme’s functions.php file or into a site-specific plugin:

add_filter( 'wp_feed_cache_transient_lifetime', 
   create_function('$a', 'return 600;') );

In this example it is set to refresh every 600 seconds, or 10 minutes. Simply change this number to whatever you want and your RSS widget will refresh accordingly.

Source


Editorial Staff at WPBeginner is a team of WordPress lovers led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »
  • Canha

    This looks great and all…but what are the server-side implications?

    Lowering the refresh rate makes the server work extra hard to deliver in less time? Does this affect the database in any way?

    I also wonder if this affects blogger who use FeedBurner?

    I’m manly curious because I’ve had some problems with my server a few times (too much processing consumption), causing the WordPress site to go offline. Could this hack create any problem for sites that have many visitors daily?

    Cheers on the post!

    • http://www.wpbeginner.com Editorial Staff

      Ofcourse lowering the refresh rate time increases server load. You wouldn’t do this for sites that you do not update very often. For ex. if you are pulling your blog feed where you only post once a day, then you don’t need to do this.

      Understand all we are doing here is lowering the transient cache time. It does not run the query on every pageview. For ex. if you had it set to run twice a day, you can have it run for four times a day. Hope this helps your question about daily visitors.

      • Canha

        Great to know! Thanks!

  • http://www.facebook.com/profile.php?id=100003862505833 Keith Davis

    Useful info as ever boys.
    I’m still rather taken with the comment system you have set up here.

    Like the idea of integrating twitter and facebook.

  • Kaushik Biswas

    Wonderful. This was very helpful for my blog’s sidebar widget :) Thanks!