Automating Imports & Exports with Server Cron Jobs
Why Use Server Cron Jobs?
WordPress built-in wp-cron.php only runs when a visitor visits your website. For critical tasks like syncing product inventory every hour or exporting daily orders at midnight, setting up a real Linux / cPanel server cron job is strongly recommended for 100% reliability.
Obtaining Your Scheduling URL & Secret Key
- Edit your saved Import or Export template.
- Navigate to the Scheduling / Automation tab.
- You will find your unique Trigger URL and Processing URL:
https://yourdomain.com/wp-load.php?import_key=YOUR_SECRET_KEY&import_id=12&action=trigger https://yourdomain.com/wp-load.php?import_key=YOUR_SECRET_KEY&import_id=12&action=process
Configuring cPanel Cron Jobs
In your cPanel dashboard, search for Cron Jobs and add the following two commands:
1. Trigger Cron (Runs once per day or hour)
curl -s "https://yourdomain.com/wp-load.php?import_key=YOUR_KEY&import_id=12&action=trigger" > /dev/null 2>&1
2. Process Cron (Runs every 2 minutes until complete)
curl -s "https://yourdomain.com/wp-load.php?import_key=YOUR_KEY&import_id=12&action=process" > /dev/null 2>&1
Performance Tip: The process cron safely checks if the import has work remaining and shuts down automatically when all records have been imported.
