Publish to the RSS feed 15 minutes later
New posts appear in your RSS feed 15 minutes after publishing, so you have time to fix a typo before feed readers and email newsletters pick them up.
<?php
add_filter(
'posts_where',
static function ( $where, $query ) {
if ( $query->is_main_query() && $query->is_feed() ) {
global $wpdb;
$where .= $wpdb->prepare( " AND {$wpdb->posts}.post_date_gmt <= %s", gmdate( 'Y-m-d H:i:s', time() - 15 * MINUTE_IN_SECONDS ) );
}
return $where;
},
10,
2
);
In these packs
- RSS feeds: Control what your RSS feed shows, and when.