Black Friday: Up to 40% off all plans!

Offer automatically applied at checkout
Days
Hours
Minutes
Seconds

FAQs

Find answers to common questions and step-by-step solutions.

Glossary

An alphabetical list of terms and their definitions.​

Video Library

Discover our tutorials

This help doc applies to version 4. If you’re using version 5, please refer to the updated documentation here.

Add a Custom Cron Interval for Feed Processing

Contents

Use the below code snippet to see the new cron interval show up in the list shown in the WP RSS Aggregator Feed Processing settings. You can set the number of seconds and the display name as you wish.

add_filter( 'cron_schedules', 'cron_add_weekly' );

function cron_add_weekly( $schedules ) {
   // Adds once weekly to the existing schedules.
   $schedules['weekly'] = array(
    'interval' => 604800, // 60sec*60min*24hours*7days
    'display' => __( 'Once Weekly' )
   );
   return $schedules;
}

How do I add this to my site?

Follow the step-by-step instructions below to add this filter to your WordPress site.

  1. Copy the code you need from above.
  2. Go to your WordPress site’s dashboard.
  3. Go to Plugins > Add New.
  4. Search for Code Snippets, then install and activate the plugin.
  5. Once installed and activated, go to Snippets in your dashboard menu.
  6. Click on Add New.
  7. Add a Title, which could be the title of this article.
  8. Paste the code you copied in step 1 to the Code section.
  9. Add a Description or Tags if you wish to do so. It is not required.
  10. Click on Save Changes and Activate to save the filter and activate it.
    1. Or click on Save Changes to save the filter and activate it later.
  11. Your action or filter is now stored and active on your site.
GIVE FEEDBACK

Was this article helpful?

Still stuck?

Find Your Perfect Plan

Answer a few questions, and we’ll recommend the best option for you!