Feeds and sync
8 min read
A data feed keeps a data table in step with a source outside the table: a Google Sheet, or your own WordPress content. A table has one feed. You set it up once; Sync now reads the source and updates the rows. On the Business plan and above the feed can also sync by itself on a schedule.
Open the table, go to the Import & feed tab, and find the Data feed card: "Fill this data table from a Google Sheet or from your WordPress content instead of uploading files."
Plans
What | Pro | Business, Agency and trial |
|---|---|---|
Set up a feed, Sync now | Yes | Yes |
Sync automatically (hourly, 6-hourly, daily, weekly) | No. The control is disabled with a plan badge and the text "Scheduled sync is part of the Business plan. You can always sync by hand." | Yes |
If a Business license drops to Pro, or expires, scheduled runs stop (Scheduled sync is available on the Business plan and above.); a feed you saved stays and Sync now keeps working on Pro. While the license is expired nothing syncs (Syncing needs an active license.).
Set up a feed
- In Rows come from choose the source:
Option | Source |
|---|---|
Upload CSV files by hand | No feed. Rows come from CSV imports. Choosing it and saving removes the feed. |
Google Sheets link | A published or shared Google Sheet (or another CSV link on an allowed host). |
WordPress content | Published posts of one post type. |
WordPress categories and tags | The terms of one taxonomy. |
WooCommerce products | Products, with price, SKU and stock. Offered only when WooCommerce is active; otherwise the help says "WooCommerce products appear here when WooCommerce is active." |
- Fill in the source details (below). For a Google Sheets link click Read columns; the other sources read their columns as soon as they are chosen.
- Under Match columns choose, for each column of your table, the feed column that fills it (picker Feed column for {label}, or - Skip -). Columns whose name matches a feed column are suggested, but only into an empty mapping.
- Under Existing rows choose how the feed treats rows already in the table. A feed offers two options only: Update rows with the same unique value, add the rest and Replace them with the new rows (rows missing from the new data are deleted). Appending is not offered, because it would add every row again on each sync. The options behave exactly like in an import; both want a unique column in Match rows by... (for Replace the match field is optional but recommended, because it keeps row IDs and with them the generated pages).
- Optionally set Sync automatically (Business).
- Click Save feed. A toast says "Data feed saved. Sync now to fill the data table."
- Click Sync now. While it runs you see a progress bar and
Syncing... N rows so far. You can leave this page; the sync continues in the background.
Sync now is disabled while there are unsaved changes ("Save your changes before syncing.") and while a sync runs. To remove the feed choose Upload CSV files by hand in Rows come from and click Remove feed. The rows stay; only the feed and its schedule go. Deleting the table removes its feed too.
Status
Under the form the card shows:
Last sync 5 minutes agowith a message such as9 rows synced, 0 failed., orLast sync failed 5 minutes agofollowed by the reason and "The rows from the previous sync were kept.";- Some rows could not be written, with the first few database messages;
- The sync stopped, when a run gave up after its retries;
Next scheduled sync: {date and time}when a schedule is active.
A failing source never empties the table: the feed is read and checked before any row is touched.
Google Sheets link
Paste the address of your sheet into Google Sheets link:
- Share link (
https://docs.google.com/spreadsheets/d/.../edit#gid=0): share the sheet with Anyone with the link (viewer). The plugin turns the link into the sheet's CSV export, and honours the tab (gid). - Publish to the web link (File › Share › Publish to the web › Comma-separated values): also works. The
pubhtmllink is converted to its CSV form. - A direct link to a CSV file works if its host is allowed (see below).
Rules the plugin enforces:
- Only
https://links. A link starting withhttp://is refused (Enter a valid link.). - No user name or password in the address (
Links with a user name or password cannot be used.). - Only allowed hosts:
docs.google.comanddoc-*-sheets.googleusercontent.com(where Google redirects exports). Any other host is refused:Links to example.com are not allowed. Use a Google Sheets link, or allow the host with the wpmcf/data_tables/feed_hosts filter.Redirects are followed by hand (at most three) and every hop is checked again. - Addresses that point to your own network (localhost, private and reserved IP addresses) are refused by WordPress's safe HTTP layer.
- The answer must look like CSV. A web page instead of CSV gives
The link returned a web page instead of CSV. In Google Sheets use File › Share › Publish to the web as CSV, or share the sheet with "Anyone with the link". - Size limit 20 MB (
wpmcf/data_tables/feed_max_bytes) and a 30 second timeout (wpmcf/data_tables/feed_timeout).
Columns are matched by the header text of the sheet's first row, so reordering the sheet's columns does not break the sync. If a header you mapped is gone, the sync stops: The column "Price" is missing from the file. Check the sheet or change the column mapping. The first sheet row must be the header row.
Allow another host
Add the host to the wpmcf/data_tables/feed_hosts filter, in a small plugin or your theme's functions.php:
add_filter( 'wpmcf/data_tables/feed_hosts', function ( array $hosts ): array {
$hosts[] = 'example.com'; // exactly this host
$hosts[] = '*.cdn.example.org'; // any sub-domain, but not cdn.example.org itself
return $hosts;
} );A * inside a name matches within one label only. The link must still be https and still has to answer with CSV.
Messages for a Sheets link
Message | Meaning |
|---|---|
| HTTP 401 or 403. |
| HTTP 404. |
| Any other failure. |
| Network error or timeout. |
| More than three redirects. |
| Zero bytes. |
| Over the feed limit. |
| A PDF, a ZIP or an image. |
WordPress content feeds
These read your own site, so they need no link.
WordPress content reads the published, not password-protected posts of the Post type you choose (the list offers public post types that have an admin screen, except Media; help text: "Only published posts without a password are read.").
Feed column | Value |
|---|---|
ID, Title, Slug, Excerpt (tags stripped), Permalink | Basics of the post. |
Publish date, Last modified |
|
Author name, Featured image URL, Parent title | Display name, full-size image address, title of the parent. |
One column per public taxonomy of the type, for example Categories, Tags | The term names separated by |
| The top-level fields of field groups that apply to that post type, as plain text. The column key is |
With WooCommerce products the same list gains Price, Regular price, Sale price, SKU and Stock status, and products hidden from the catalog are left out.
WordPress categories and tags reads the terms of the Taxonomy you choose (public taxonomies with an admin screen): ID, Name, Slug, Description, Permalink, Number of posts, Parent name, plus the field group columns that apply to that taxonomy.
A good unique column for a content feed is the ID (a Number column marked Unique) or the slug.
Schedule (Business)
Sync automatically offers Only when I click Sync now, Every hour, Every 6 hours, Daily and Weekly.
- The first scheduled run starts one interval after you save the feed, not at once. Click Sync now for an immediate run.
- Times are kept in UTC and shown in your browser's time zone.
- Through the API any interval from 15 minutes to a year is accepted; shorter values are raised to 15 minutes.
- Scheduled runs use WP-Cron / Action Scheduler like every background job. On a quiet site or with WP-Cron disabled use a system cron job; see Background tasks.
- Programmatic SEO tasks that read the table pick the changes up on their next run; see Programmatic SEO.
Other sync errors
Message | Meaning |
|---|---|
| Nothing is mapped (also when you removed the mapped columns from the table). |
| Saving with Update (or Replace with a match field) without a mapped unique column. |
| The same check at sync time, after the table's columns changed. |
| A content feed column disappeared (for example a field group changed). |
| The table was deleted while a sync ran. |
| WooCommerce products without WooCommerce. |
| The source detail is empty. |
For developers
wpmcf/data_tables/feed_hosts, wpmcf/data_tables/feed_max_bytes and wpmcf/data_tables/feed_timeout are listed in the filters reference. When a sync finishes wpmcf/data_tables/synced fires with the table key and a summary.
Still stuck? Contact support