WordPress filter hook · part of WordPress core

wp_feed_cache_transient_lifetime

A WordPress core filter that 22 plugins also fire themselves, running on 86K+ sites between them.

“This filter is documented in wp-includes/class-wp-feed-cache-transient.php”

How to use wp_feed_cache_transient_lifetime

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'wp_feed_cache_transient_lifetime', function( $value, $url ) {
	// Change $value here.
	return $value;
}, 10, 2 );

Argument names come from Go Fetch Jobs (for WP Job Manager)'s source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

22 plugins that fire wp_feed_cache_transient_lifetime

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. RSS Aggregator by Feedzy icon RSS Aggregator by Feedzy40,000+ installs apply_filters( 'wp_feed_cache_transient_lifetime', $cache_time, $feed_url ) includes/abstract/feedzy-rss-feeds-admin-abstract.php:1266
  2. PowerPress Podcasting plugin by Blubrry icon PowerPress Podcasting plugin by Blubrry20,000+ installs apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $feed_url ) powerpressadmin-dashboard.php:34
  3. Shapely Companion icon Shapely Companion10,000+ installs apply_filters( 'wp_feed_cache_transient_lifetime', 7200, $this->feeds ) inc/epsilon-dashboard/class-epsilon-dashboard.php:112
  4. FeedWordPress icon FeedWordPress8,000+ installs apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $filename ) extend/SimplePie/1.5.3/feedwordpie_cache.class.php:77
  5. Illdy Companion icon Illdy Companion6,000+ installs apply_filters( 'wp_feed_cache_transient_lifetime', 7200, $this->feeds ) inc/epsilon-dashboard/class-epsilon-dashboard.php:126
  6. Friends icon Friends900+ installs apply_filters( 'wp_feed_cache_transient_lifetime', HOUR_IN_SECONDS - 600, $url ) feed-parsers/class-feed-parser-simplepie.php:291
  7. Go Fetch Jobs (for WP Job Manager) icon Go Fetch Jobs (for WP Job Manager)600+ installs apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) includes/class-gofetch-importer.php:1719
  8. RSS Just Better icon RSS Just Better300+ installs apply_filters( 'wp_feed_cache_transient_lifetime', $cachefeed, $feed ) RSS-just-better.php:932
  9. RSS Via Shortcode for Page & Post icon RSS Via Shortcode for Page & Post200+ installs apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) rss-via-shortcode.php:98
  10. PressForward icon PressForward100+ installs apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) includes/functions.php:656
  11. All-in-one Widget icon All-in-one Widget100+ installs apply_filters( 'wp_feed_cache_transient_lifetime', 7200, $feedURL ) widgets/widget-rssfeed.php:312
  12. RSS Blogroll icon RSS Blogroll100+ installs apply_filters( 'wp_feed_cache_transient_lifetime', $cache_seconds ) rss-blogroll.php:176
  13. BNS SMF Feeds icon BNS SMF Feeds50+ installs apply_filters( 'wp_feed_cache_transient_lifetime', $feed_refresh ) bns-smf-feeds.php:525
  14. Amazon Product Feeder icon Amazon Product Feeder40+ installs apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) amazon-product-feeder.php:158
  15. Top Music Charts Widget icon Top Music Charts Widget20+ installs apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) top-music-charts-widget.php:86
  16. JS Widgets icon JS Widgets10+ installs apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) core-adapter-widgets/rss/class.php:228
  17. Social Glutton icon Social Glutton10+ installs apply_filters( 'wp_feed_cache_transient_lifetime', $time, $url ) socialglutton.php:267
  18. SuperRSS by Leo Balter icon SuperRSS by Leo Balter10+ installs apply_filters( 'wp_feed_cache_transient_lifetime', $set_rss_cache_time ) superrss.php:340
  19. feed-modify-on-your-choice icon feed-modify-on-your-choice10+ installs apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) feedfile/feed.php:540
  20. WP Jump icon WP JumpFewer than 10 installs apply_filters( 'wp_feed_cache_transient_lifetime', function( $sec ) { return 7200; } ) framework/class-bootstrap.php:24
  21. SB Insights RSS Feed Plugin icon SB Insights RSS Feed PluginFewer than 10 installs apply_filters( 'wp_feed_cache_transient_lifetime', $instance['feed_cache_input']*HOUR_IN_SECONDS ) insights-samsung-feed.widget.php:14
  22. Chiron icon ChironFewer than 10 installs apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) core/classes/source.class.php:76

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.