Skip to content

Instantly share code, notes, and snippets.

@deepak-rajpal
Created November 20, 2015 14:48
Show Gist options
  • Save deepak-rajpal/e9a74d3b0962541f5284 to your computer and use it in GitHub Desktop.
Save deepak-rajpal/e9a74d3b0962541f5284 to your computer and use it in GitHub Desktop.
Change WordPress cache feed time from defalut 12 hours to 30 minutes
<?php
/* By default, WordPress cache feed or rather the cached feed has a lifetime of 43200 seconds, equivalent to 12 hours. */
/* Starts: Change the default feed cache recreation period to 1800 seconds/30 minutes */
function return_cache_recreation( $seconds )
{
return 1800;
}
add_filter( 'wp_feed_cache_transient_lifetime' , 'return_cache_recreation' );
/* Ends: Change the default feed cache recreation period */
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment