Do you want to delay posts from appearing in your site’s RSS feed?
Delaying posts from appearing immediately can save you from sending out unfinished work accidentally, give you time to edit typos you might see, and help you beat content scrapers in SEO.
In this article, we will show you how to delay posts from appearing in WordPress RSS feed.
Why Delay Your RSS Feed in WordPress?
Sometimes you may publish something on your WordPress blog with a typo that you just didn’t see. The mistake is then distributed to your RSS feed and all of your subscribers. If you have email subscriptions on your WordPress blog, then those subscribers will get it as well.
By adding a delay between your RSS feed and your live site, you get a little window of time to catch an error on a live site and fix it.
RSS feeds are also used by content scraping websites. They use it to monitor your content and copy your posts as soon as they appear live. If you have a new website with little authority, then a lot of times these content scrapers may end up beating you in the search results.
By delaying an article in your feed, you can give search engines enough time to crawl and index your content first.
Having said that, let’s see how to easily delay posts from appearing in WordPress website‘s RSS feed.
How to Delay Posts in Your WordPress RSS Feed
To begin, we recommend using WPCode to delay posts from appearing in your site’s feed. WPCode lets you add custom code to WordPress safely and easily without having to worry about your site breaking.
For advanced users, you can copy/paste the following code into your theme’s functions.php file instead. You’ll need to modify the code to change the time interval.
Note: Remember that editing your core WordPress files can be dangerous, which is why we recommend WPCode. You’ll also lose any custom code snippets when you update your theme.
For details, see our article on how to paste code snippets from the web into WordPress.
function wpb_snippet_publish_later_on_feed( $where ) {
global $wpdb;
if ( is_feed() ) {
// Timestamp in WP-format.
$now = gmdate( 'Y-m-d H:i:s' );
// Number of unit to wait
$wait = '10'; // integer.
// Choose time unit.
$unit = 'MINUTE'; // MINUTE, HOUR, DAY, WEEK, MONTH, YEAR.
// Add SQL-sytax to default $where. By default 10 minutes.
$where .= " AND TIMESTAMPDIFF($unit, $wpdb->posts.post_date_gmt, '$now') > $wait ";
}
return $where;
}
add_filter( 'posts_where', 'wpb_snippet_publish_later_on_feed' );
Now we’ll show you how to do this the easy way with WPCode.
First, you will need to install and activate the free WPCode plugin. For details, you can follow our step-by-step guide on how to install a WordPress Plugin.
Upon activation, you can navigate to Code Snippets » Add Snippet. After that, simply search for ‘rss’ or scroll down to the ‘RSS Feeds’ category.
Then, just hover your mouse over ‘Delay Posts in RSS Feeds’ in the results and simply click on ‘Use snippet.’
Next, you will be taken to the ‘Edit Snippet’ screen, where WPCode has pre-configured the snippet settings for you.
By default, your posts will be delayed from appearing in your RSS feed by 10 minutes from the time it’s published.
If that delay is good for you, then all you have to do is click on the switch to change it to ‘Active’ and press the ‘Update’ button.
If you want to alter the length of the delay, you can do so by changing the number on Line 10 and the unit of time on Line 13.
For example, you can delay the post by one hour if you replace $wait = '10';
and $unit = 'MINUTE'
with $wait = '1'
and $unit = 'HOUR'
.
If you need to adjust the delay again, simply repeat those steps, and if you want the posts to go back to hitting the feed immediately, simply toggle the switch back to ‘Inactive’ and press ‘Update.’
Don’t Forget to Check Out the WPCode Snippet Library
WPCode also comes with a huge collection of other code snippets, too. You can see what’s there in Code Snippets » Library in your admin dashboard.
You may be able to replace some single-use plugins on your site by simply activating snippets you find in the library.
For example, you can find snippets that will let you disable automatic updates, allow SVG uploads, set a minimum word count for posts, and much more.
We hope this article helped you learn how to easily delay posts from appearing in WordPress RSS feed. You may also want to see our guide on how to create an email newsletter the right way, or see our expert picks for the best live chat software for small business.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Syed Balkhi
Hey WPBeginner readers,
Did you know you can win exciting prizes by commenting on WPBeginner?
Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
You can get more details about the contest from here.
Start sharing your thoughts below to stand a chance to win!
Jiří Vaněk
I also have issues with content scrapers, and it bothers me quite a bit because someone is illegally trying to steal my content. Since I would like to address this issue, I will try implementing the RSS delay mentioned here. I hope this helps resolve the problem or at least minimize it.
Dayo Olobayo
As someone who has been stung by content scrapers in the past, I’m very interested in this technique for delaying posts from appearing in the RSS feed. It seems like a clever way to thwart these automated bots that steal my content. Thanks for sharing.
Kurt
I use the Code Snippets plugin. Should this function be ran: everywhere, only in the admin area, or only on the site front-end?
WPBeginner Support
From those options it would run on the front-end or everywhere.
Admin
CNXSoft
It looks like it may not work anymore. I have the following error with this code:
unexpected variable “$wpdb”
WPBeginner Support
The code should still be working, we would recommend taking a look at our guide below to ensure the code was added properly:
https://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/
Admin
Eric Xiao
Is it possible to show a new RSS feed entry at a particular time of the day?
WPBeginner Support
Hi Eric,
The easiest way to do this is by publishing your posts at a particular time of the day. However, caching and user’s rss feed crawlers can still affect when your entry actually appears on user’s RSS feed readers or inbox.
Admin
Melika
Thanks for the tutorial.
The part that you mentioned content scrapers got me a little worried. So I wanted to ask if you use this method yourself to avoid problems with content scrapers and indexing …
Melika
Now i know what i asked was kind of funny
Because i see that you have mentioned “website with little authority”
Thanks again for the article
Bob
Fantastic tip that will stop an ongoing source of embarrassment. Thanks!