Scheduling Automated Imports with Super Speedy Imports
The easiest way to schedule is the Schedule tab. It lets you pick an import and a cadence (once, hourly, daily or weekly) at a run time in your site’s timezone, with per-run and daily-summary email alerts, and no crontab editing. See Scheduling imports and getting alerts. This guide covers the manual crontab approach, which suits you when you want full control over timing or already manage jobs in crontab.
Super Speedy Imports provides a powerful CLI command (wp ssi) that allows you to run imports from the command line. While this is useful for manual imports, you may want to automate your imports to run on a schedule. This guide will show you how to use crontab to schedule your imports to run automatically.
Step 1: Understanding the Basic Import Command
The basic command to run an import is:
wp ssi [import_id] [stages]
Where:
[import_id]is the ID of your import (e.g., 1, 2, 3)[stages]is optional. Leave it out to run the stages the import’s What should this import do? setting selects. Give a comma-separated list, such asload-csv,match-existing,update-postmeta, to run exactly those stages for this run instead. A name that is not one of the import’s stages stops the command with an error listing the valid ones, and nothing runs.
For example, to run import #1:
wp ssi 1
Step 2: Setting Up a Basic Cron Job
Cron is a time-based job scheduler in Unix-like operating systems. You can use it to schedule commands to run periodically.
- Access your server via SSH or through your hosting provider’s terminal
- Open the crontab editor:
crontab -e
If this is your first time using crontab, you may be asked to choose an editor. If you’re not familiar with vim, choose nano (usually option 1).
Then add a line to schedule your import:
# Run import #1 every day at 2 AM
0 2 * * * cd /path/to/your/wordpress && wp ssi 1 > /path/to/logfile.log 2>&1
The cron schedule format is:
minute hour day-of-month month day-of-week command
Common schedule examples:
0 2 * * *– Every day at 2 AM0 */6 * * *– Every 6 hours0 0 * * 0– Every Sunday at midnight0 0 1 * *– First day of every month at midnight
Step 3: Downloading a Remote File Before Import
If you need to download a file before running the import, you can chain commands using && (which runs the next command only if the previous one succeeds):
# Download file then run import #1 with the downloaded file
0 2 * * * cd /path/to/your/wordpress && wget -O /path/to/wordpress/wp-content/uploads/super-speedy-imports/latest-data.csv https://example.com/data-feed.csv && wp ssi 1 --file=latest-data.csv > /path/to/logfile.log 2>&1
The --file parameter tells Super Speedy Imports to use a specific CSV file instead of the one configured in the import settings.
Step 4: Running Multiple Imports in Sequence
You can run multiple imports one after another by chaining commands:
Running Second Import Only if First Succeeds
Use the && operator to run the second import only if the first one completes successfully:
0 2 * * * cd /path/to/your/wordpress && wp ssi 1 && wp ssi 2 > /path/to/logfile.log 2>&1
Running Second Import Regardless of First Import’s Result
Use the ; operator to run the second import regardless of whether the first one succeeds:
0 2 * * * cd /path/to/your/wordpress && wp ssi 1; wp ssi 2 > /path/to/logfile.log 2>&1
Step 5: Running WooCommerce Regeneration After Import
Each import’s After Import settings decide which term recounts and WooCommerce lookup rebuilds run when it finishes, and wp ssi runs them as part of the import. Add commands like these to the cron line only for work those settings leave off:
0 2 * * * cd /path/to/your/wordpress && wp ssi 1 && wp taxonomy list --field=name | xargs wp term recount && wp wc tool run regenerate_product_attributes_lookup_table --user=admin && wp wc tool run clear_transients --user=admin && wp wc tool run regenerate_product_lookup_tables --user=admin > /path/to/logfile.log 2>&1
Replace admin with a WordPress username that has privileges to update WooCommerce product stats.
Step 6: Viewing Cron Job Logs
To see the output of your cron jobs, you can redirect the output to a log file as shown in the examples above (> /path/to/logfile.log 2>&1).
To view the log:
cat /path/to/logfile.log
Or to see the log in real-time as it’s being written:
tail -f /path/to/logfile.log
Step 7: Sending Email Notifications After Completion
Every edition has built-in email reports for each finished run, including runs started by wp ssi from cron. Set them up under Schedule → Email reports; see Scheduling imports and getting alerts. If you would rather have cron mail you the command output, use the system mail command:
0 2 * * * cd /path/to/your/wordpress && wp ssi 1 > /tmp/import-log.txt 2>&1 && mail -s "Import Completed" your@email.com < /tmp/import-log.txt
For a more detailed email with success/failure information:
0 2 * * * cd /path/to/your/wordpress && { wp ssi 1 && echo "Import completed successfully" || echo "Import failed with error code $?"; } | mail -s "Import Status" your@email.com
Troubleshooting
If your cron jobs aren’t running as expected:
- Check that the WordPress path is correct
- Ensure the user running the cron job has permission to execute WP-CLI
- Verify that WP-CLI is installed and accessible
- Check your log files for error messages
- Make sure your server’s time is set correctly
If you’re using a managed hosting provider, they may have their own cron job interface instead of the command-line crontab. Consult your hosting provider’s documentation for details.
Summary
You’ve learned how to schedule automated imports with Super Speedy Imports using crontab. You can now set up recurring imports that download files, process data, and update your WooCommerce store automatically. This automation can save you significant time and ensure your product data is always up to date.
Written for Super Speedy Imports 3.40.0.

Comments