Refresh External RSS Feeds More Often
Changes how long WordPress caches feeds fetched from other sites for the RSS widget and feed shortcodes, which is 12 hours by default.
Opens WPIDE on
Code
// Cache time for external feeds, in seconds.
$wpide_feed_cache_seconds = HOUR_IN_SECONDS;
add_filter( 'wp_feed_cache_transient_lifetime', function () use ( $wpide_feed_cache_seconds ) {
return max( 600, (int) $wpide_feed_cache_seconds );
} );
Notes
Very short times add load to your server and to the source site; one hour is a sensible minimum.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.