Family Encyclopedia >> Electronics

How to delay publishing posts in WordPress RSS Feed

Recently, one of our readers asked if it is possible to delay posts from appearing in the WordPress RSS feed. Delaying posts to your RSS feed can save you from accidental posting and outperform content scrapers in SEO. In this article, we will show you how to delay WordPress RSS posting.

How to delay publishing posts in WordPress RSS Feed

Why delay the feed in WordPress?

Sometimes, you may end up with a grammar or spelling mistake in your article. The bug is launched and distributed to RSS subscribers. If you have email subscriptions to your WordPress blog, then those subscribers will receive it as well.

How to delay publishing posts in WordPress RSS Feed

By adding a delay between your RSS feed and your live site, you give yourself a small window of time to catch an error on a live site and fix it.

RSS feeds also use RSS feeds. They use it to monitor your content and copy your posts as soon as they go live.

If you have a new website with little authority, many times these content crawlers can end up outranking you in search results.

How to delay publishing posts in WordPress RSS Feed

By delaying an article at the source, you can give search engines enough time to crawl and index your content first.

With that said, let's see how to easily delay posts from appearing in the WordPress RSS feed.

Delaying WordPress RSS Feed Posts

This method requires you to add little code in WordPress. If this is your first time adding code manually, take a look at our beginner's guide on how to paste web code snippets into WordPress.

You need to add the following code to your theme's functions.php file or in a site-specific plugin.

 función publish_later_on_feed ($ where) global $ wpdb; if (is_feed ()) // marca de tiempo en formato WP $ ahora = gmdate ('Y-m-d H: i: s'); // valor para esperar; + dispositivo $ espera = '10'; // integer // http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff $ device = 'MINUTE'; // MINUTO, HORA, DÍA, SEMANA, MES, AÑO // agregue la sintaxis de SQL a $ por $ donde. "; devuelve $ donde; add_filter ('posts_where', 'publish_later_on_feed'); 

This code checks if a WordPress source is requested. After that, you set the current time and the time you want to add as a delay between the original date of the post 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 posts where the timestamp difference is greater than the timeout.

In this code we have used 10 minutes as the timeout or delay. Feel free to change that to any number of minutes you'd like. For example, 60 for 1 hour or 120 for two hours.

We hope this article helped you learn how to easily delay the posts that appear in the WordPress RSS feed. You can also refer to our guide on how to display content only to RSS subscribers in WordPress.

If you enjoyed this article, please subscribe to our WordPress YouTube Channel video tutorials. You can also find us on Twitter and Facebook.