Why Delay Feed in WordPress?
Sometimes you may end up with a grammar or spelling mistake in your article. The mistake goes live and is distributed to your RSS feed 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 time window 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 the 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 RSS feed.
Delaying Posts in WordPress RSS Feed
This method requires you to add little code into WordPress. If this is your first time adding code manually, then take a look at our beginner’s guide on pasting snippets from web into WordPress.
You need to add the following code to your theme’s functions.php file or in a site-specific plugin.
This code checks to see if a WordPress feed is requested. After that it sets the current time and the time you want to add as delay between post’s original date and the current time.
After that it adds the timestamp difference as the WHERE clause to the original query. The original query will now only return the posts where timestamp difference is greater than the wait time.
In this code we have used 10 minutes as $wait or delay time. Feel free to change that into any number of minutes you want. For example, 60 for 1 hour or 120 for two hours.