Tk Listing Importer
Adds automatic listing import/export functionality to wordpress
by Mick Mifsud · github.com/tropotek/tk-listing-importer · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/tropotek/tk-listing-importer/archive/refs/heads/master.zipImports property listings from a master site running tk-listing-exporter into
this site, keeping them in sync automatically. Runs on the "slave" sites
(e.g. roatanmike.com, roatanbeachrealestate.com); the master is roatanlife.com.
Contents
- How it works
- Installation
- Settings
- Running a manual import
- Scheduling repeating imports
- Making the schedule reliable (server cron)
How it works
The importer pulls published listings from the master site's REST API and
updates them in place — matching each local listing to its source by a hidden
_tk_source_id tag. New listings are added, changed listings are updated, and
listings removed on the master are taken down here. Local post IDs and page
addresses (slugs) are preserved, so links keep working.
The work is done in small background batches rather than one big request, so an import can't hit the PHP timeout no matter how many listings there are. If a batch is interrupted it simply resumes on the next run — the site is never left with a half-wiped set of listings.
Installation
Place the plugin in your WordPress wp-content/plugins folder, then go to
Plugins in wp-admin and activate Tk Listing Importer.
Settings
Before you start, ask the master site's admin to create an export client for you in tk-listing-exporter (Settings → Listing Export → Create Export Client). They'll give you a Provider URL and Secret Key to enter below.
Go to Settings → Listing Import. Fill in:
| Field | What it's for |
|---|---|
| Provider URL | The master site's address (e.g. https://roatanlife.com/) |
| Secret Key | The account key supplied by the listing provider |
| Import Author | The WordPress user that imported listings are attributed to |
| Import Active | Turn automatic syncing on/off |
| Sync Frequency | How often a sync runs automatically (see below) |
Click Save. The sidebar shows Last Sync and Next Sync Tick so you can see what's happening.
Note: the first sync after saving — whether triggered by Sync Now or by the first scheduled tick — can take a while before anything visibly happens. It starts by requesting a full manifest of listings from the master site, and on a master with a large number of listings that can take some time to build and return. This is normal; let it run rather than clicking Sync Now again.
Running a manual import
To import on demand:
- Go to Settings → Listing Import.
- Click the Sync Now button.
- A status message next to the button updates as it works, for example "upsert — 80 remaining" → "images — 200 remaining" → "Sync complete."
You can watch it finish or navigate away — it keeps running in the background. This works reliably even for very large imports because it runs in small batches.
Scheduling repeating imports
- Go to Settings → Listing Import.
- Choose a Sync Frequency:
- Off (manual only) — never runs on its own; use Sync Now
- Daily
- Every 3 days
- Weekly
- Fortnightly
- Monthly
- Click Save.
That's it — no sysadmin required. Behind the scenes the site checks in every few minutes and, when the interval you chose has elapsed, starts a fresh sync and then advances it a little at a time until it finishes. A large sync spreads itself out safely instead of running all at once.
Making the schedule reliable (server cron)
WordPress's built-in scheduler (WP-Cron) only runs when someone visits the site. On a busy site that's fine. On a quiet site, a scheduled sync may wait until the next visitor arrives.
For guaranteed timing regardless of traffic, add a server cron job that pings WordPress's cron endpoint on a schedule — for example every 5 minutes:
*/5 * * * * curl -s "https://roatanmike.com/wp-cron.php?doing_wp_cron" > /dev/null
When using a server cron, it's best to also disable the visitor-triggered cron by
adding this to wp-config.php:
define('DISABLE_WP_CRON', true);
With that in place, the Sync Frequency setting fully controls the cadence and it fires on time, every time.