Data sources
6 min read
A task reads its rows from a data source. There are two kinds.
Kind | Where it lives | Good for |
|---|---|---|
Data table | Data Tables screen (Pro). A real database table of your own columns. | Spreadsheets, directories, product lists, anything you import or sync |
Field group table | Field Groups. The table behind a field group (one row per post, term, user, …). | Pages built from values you already store with custom fields |
In the task editor, step Data, the source list is split into your data tables and a Field Groups group. A source appears only when its table exists.
Data tables
Create one with New data table (on the Programmatic SEO screen or in Data Tables), define its columns, then fill it in one of these ways:
Way | Notes |
|---|---|
By hand | Add rows in the table screen. |
CSV import | Import CSV on the table's Import & feed tab. The first row must hold the column names; comma, semicolon and tab are detected. Large files import in the background. Mark a column Unique to update existing rows instead of adding duplicates. |
Google Sheets link | A data feed. In Google Sheets use File › Share › Publish to the web › Comma-separated values, or share with "Anyone with the link", and paste the address. Only https links to Google are accepted by default. |
WordPress content | A data feed of published posts, pages or any public post type. |
WordPress categories and tags | A data feed of terms. |
WooCommerce products | A data feed, offered only while WooCommerce is active. |
Forms | Rows can also arrive from front-end forms (Pro). |
Feeds are filled with Sync now (any Pro plan) or Sync automatically on a schedule (Business). A feed keeps the rows of the last successful sync if a sync fails.
What the WordPress content feeds provide
- Posts of a type (including WooCommerce products): published posts without a password only. Columns:
id,title,slug,excerpt,permalink,date,modified,author(display name),image(featured image URL),parent(parent title), one column per public taxonomy (tax.category,tax.product_cat, …, term names joined by commas) and the fields of your field groups. Products addprice,regular_price,sale_price,skuandstock_status; products hidden from the catalog are left out. - Terms: the term fields of a taxonomy.
The details of creating tables, imports and feeds belong to the Data Tables screen; this page only covers what a task needs.
Field group tables
Choose a field group in the Field Groups part of the source list. Each row of its table becomes a page. Besides the field columns you get an id column. Remember that one row exists per object (per post, per user, …), so use filters if you only want some of them.
Field group tables do not trigger updates: when their values change, pages update at the task's next run (scheduled or by hand), not instantly. Data tables do trigger updates, see Freshness and caches.
Columns in your templates
Every column is available as a variable:
{{ pseo.src.<source key>.<column> }}For the sample data: {{ pseo.src.sample_cities.name }}. The editor shows variable chips: click a chip to insert it into the field you edited last. In combination mode the same source can appear several times, then the second use is written {{ pseo.src.cities.name.2 }} (see below).
Values of decimal (number) columns arrive as stored, for example 1234.500000; format them with a filter: {{ pseo.src.products.price | number(2) }} prints 1,234.50. See URL and title patterns for the filters.
Imported data can never become a template: braces ({{) in a cell are neutralized and square brackets are encoded so a cell cannot call a shortcode. In text positions (titles, meta tags, URLs) HTML is stripped; in page content only the HTML that WordPress allows in posts is kept.
Filters: only use some rows
Under the source click + Only use some rows. Each condition has a Column, a Condition and a Value ("only where … and …"):
Condition | Meaning |
|---|---|
is / is not | equals / does not equal |
contains / does not contain | text search |
greater than / at least / less than / at most | numeric comparison |
is one of / is none of | comma-separated list of values |
is empty / is not empty | no value needed |
Rules:
- Conditions are combined with and; at most 20 per source.
- Filter columns must exist in the source ("The filter column "zzz" does not exist in the data source." when saving).
- Filters are applied on every run. A row that stops matching has its page removed at the next run (it answers 410, see Serving pages); a row that starts matching gets a page.
- Changing only the filters does not reset the task's pages.
Example: pages only for rows with country is one of France, Spain and price greater than 0.
The Preview at the end of the URL step shows how many rows match and what the first pages will look like ("About 3 pages will be generated.", or "No rows match — check the data and conditions.").
One source or several
The step Data asks What should become a page?
Mode | Source items | Result |
|---|---|---|
One page per row | exactly one | "Every row of the data becomes a page, e.g. one page per city." |
One page per combination (Business) | 2 to 4 | "Every pair (or triple) of rows becomes a page, e.g. “Paris vs Berlin”." |
In row mode only one source is kept; if more are sent (for example through the REST API) the extras are ignored.
In combination mode use Add another item for each part of the combination (Item 1, Item 2, …). Every item has its own source and its own filters. The items can be:
- the same source repeated (comparisons such as "Lyon vs Porto"): rows are paired so that
A vs Bexists once; there is noA vs Aand noB vs A; - different sources (every city with every topic, "Lyon hotels", "Lyon museums"): every row of item 1 with every row of item 2. Different sources need the Business plan, like combination mode itself.
Variables in combination mode:
Variable | Meaning |
|---|---|
| first item that uses source |
| second use of the same source |
| a different source |
The number of combinations grows quickly (1,000 rows paired with 1,000 rows is about 500,000 pages) and the page limit of your plan applies, see Limits and plans. Use filters to keep it sensible.
Changing the source of a task
Pages are identified by their source rows. If you change which sources a task reads (or switch between row and combination mode), the editor warns: "You changed which data this task reads. Saving deletes its current pages and generates them again." Manually edited titles, URLs and values of those pages are lost. Changing filters, patterns or SEO settings does not do this.
Deleting a source
A data table that a task uses cannot be deleted (the request is refused with HTTP 409 and the Data Tables screen lists the tasks that use it). Delete or change the task first. If a field group table that a task reads disappears anyway, the task stops at its next run with "The data source "…" does not exist." and keeps its existing pages.
Still stuck? Contact support