Delaying the WordPress RSS feed publishing time
Learn how to delay RSS feed publishing time on WordPress for RSS content audit. This article describes simple steps to adjust the RSS feed publishing time with a simple code snippet.
RSS(Rich Site Summary) allows a blogger or publisher to aggregate updates from their favourite site and post them on WordPress sites. Once configured, these feeds automatically post updates to your site. Although the process is automatic, you can always postpone RSS feed publishing time to validate the content before reaching your audience. This article shows you how to delay the RSS feed publishing time.
Configuring RSS feed publishing time
Important
Always perform a backup before you make any changes to the theme files. If you break any codes, it will be easier for you to revert your site to its last good known state. Alternatively, you could also create a child theme. Read this link on how to create a child theme: https://www.hosting.com/blog/wordpress-child-theme/
To edit your Theme setting file to extend the RSS feed publishing time, follow the steps below:
-
Log in to your WordPress site with an administrator account.
-
On the Dashboard in the left sidebar, click Appearance, and then click Theme Editor: ****
Tip
You can always use the default editor for the theme. This article will use the Theme Editor Plugin to edit the theme files. Refer to this link to install Theme Editor plugin: https://wordpress.org/plugins/theme-editor/
- On the Theme Editor, select the Theme you want to edit from the dropdown:
- The files for this selected theme is listed on the right column under Theme Files:
- Click on the file named "functions.php":
- Insert the following code at the end of functions.php:
function extend_rss_time_frame($where) {
global $wpdb;
if (is_feed()) {
$now = gmdate('Y-m-d H:i:s');
$wait = '100'; //extend by 100 minutes
$device = 'MINUTE';
$where.=" AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$now') > $wait ";
}
return $where;
}
add_filter('posts_where', 'extend_rss_time_frame');
-
Save the file and exit the editor.
-
The login session is now extended by 1 year instead of the default session by the login session cookie.
More Information
For more information about the please visit the following link: https://wordpress.org/plugins/theme-editor/
Related Articles
Updated 3 days ago