• I use the Feedzy plug-in to display a few RSS feeds in a widget in my sidebar

    However, WordPress only refreshes these RSS feeds every 12 hours.

    I would like to refreshes those to every 2 or 3 hours.

    What file(s) do I need to change and what do I need to put in the file to reduce the 12 hour simplepie refresh from 12 hours to less?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,@dlynch027
    Yes, it is possible.
    WordPress supports external feeds, and parse the feed using a function named fetch_feed() from SimplePie. RSS widget is one of them using the same function to fetch external feed.

    The Codex says:
    fetch_feed caches results for 12 hours by default.

    So, the feed you are fetching is actually at least 12 hours old. But a good news is there also that, you can modify the duration of the fetching by using a filter: wp_feed_cache_transient_lifetime.

    How to use that? Simple. Just paste the following code into your theme’s functions.php:

    add_filter( 'wp_feed_cache_transient_lifetime', function(){ return 1800; });
    Here,
    we are using the filter to modify the duration. Here we are passing our new duration with 1800 [seconds]. The calculation is: 30 minutes = 30 min. x 60 sec. = 1800 sec.

    Using the simple code you can change the duration.
    For more details about settings the update time of feeds you can click here

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Moved to Fixing WordPress, this is not a Developing with WordPress topic.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Lower time WordPress refreshes RSS feed’ is closed to new replies.