Get Started
How to refresh product feeds using cron jobs - AdTribes
  1. Home
  2. Knowledge Base
  3. General Feed Tips
  4. How to refresh product feeds using cron jobs

How to refresh product feeds using cron jobs

If your hosting environment throttles WordPress’s built-in task scheduler — or if you need feeds to refresh at a precise time that the plugin’s hourly, twice-daily, or daily intervals don’t match — you can drive feed refreshes from a server-level cron job instead. This gives you exact control over timing and avoids relying on visitor traffic to trigger WordPress’s scheduler.

Common symptoms: feeds stuck on old data, refresh times that drift between visits, or hosting environments that disable wp-cron.

Product Feed Pro and Product Feed Elite both support two approaches: a WP-CLI command (recommended) and a standalone PHP script for servers without WP-CLI.

If your feeds were not updating on scheduled runs on a case-sensitive server (Linux, Kinsta, or similar), this was a known bug fixed in version 13.5.4. Updating the plugin resolves the issue without requiring a custom cron setup.

Before you start

  • Product Feed Pro or Product Feed Elite installed and active
  • At least one product feed created and configured
  • SSH or cPanel access to your server to add cron jobs
  • Your feed ID (see Step 1 in either method below)
  • Version 13.5.4 or later for WP-CLI support

WP-CLI is available on most managed WordPress hosts. It’s the simplest and most reliable way to trigger a feed refresh from a server cron job — no PHP file to manage, no WordPress bootstrapping required.

Step 1: Find your feed ID

  1. Go to Product Feed → Manage Feeds in your WordPress admin.
  2. Click the feed you want to refresh.
  3. Look at the browser URL bar. The feed ID is the value of the id parameter — for example, admin.php?page=adt-edit-feed&id=123 means your feed ID is 123.

Feed ID visible in the URL bar when editing a feed

Step 2: Disable the built-in refresh interval

To prevent the plugin’s scheduler from running a duplicate refresh alongside your cron job:

  1. While editing the feed, go to the General tab.
  2. Set Refresh interval to No Refresh.
  3. Click Save Changes.

Feed with "No Refresh" Refresh interval

Step 3: Add the server cron job

On your server, add a cron entry that runs wp adt-feed refresh at your chosen schedule. Replace /path-to-wordpress with your site’s actual root directory and 123 with your feed ID:

0 2 * * * cd /path-to-wordpress && wp adt-feed refresh 123 >> /tmp/feed-refresh-123.log 2>&1

This example runs at 2:00 AM every day. Adjust the schedule expression to match your needs.

If wp is not in your server’s default PATH, use the full path to the WP-CLI binary (e.g. /usr/local/bin/wp) instead of just wp.

To refresh multiple feeds in a single cron job, list their IDs separated by spaces:

0 2 * * * cd /path-to-wordpress && wp adt-feed refresh 123 456 789

Method 2: PHP script

Use this method if your server doesn’t support WP-CLI.

The PHP script initiates feed generation by queuing it through Action Scheduler. The actual processing happens in the background — the feed won’t update in the same instant the script runs. Make sure WordPress cron (or a separate server cron hitting wp-cron.php) is active so Action Scheduler can complete the batches.

Step 1: Find your feed ID

Follow the same steps as in Method 1, Step 1 above — click your feed to edit it and read the id= value from the URL.

Step 2: Create the PHP script

Create a new file called feed-refresh-123.php (replace 123 with your feed ID) and save it in your child theme directory — for example, wp-content/themes/your-child-theme/feed-refresh-123.php.

Add this code to the file, replacing 123 with your actual feed ID:

The best WooCommerce product feed plugin

  • AdTribes Pty Ltd
    ABN: 40 675 636 816
Product
Resources & Info
Partner Sites
Rymera