Data Sources Overview

TableCrafter turns external data into responsive WordPress tables without storing anything in your database. The single source attribute on the [tablecrafter] shortcode accepts five kinds of input, and the plugin auto-detects which loader to use from the URL itself.

Remote JSONLocal FilesGoogle SheetsCSVAirtable

How source detection works

Every table is rendered by the [tablecrafter] shortcode, and the source attribute is always a URL (or a URL-like airtable:// string). When the table is first rendered, the data fetcher inspects that value and routes it to exactly one loader. The decision order is fixed:

  1. Local file — if the URL begins with your site URL, home URL, or the plugin URL, the file is read directly from disk (no HTTP round-trip).
  2. Airtable — if the value starts with airtable://.
  3. Google Sheets / CSV — if the URL matches a Google Sheets share link or ends in .csv.
  4. Remote JSON — everything else is fetched as a JSON API response.

Because detection is automatic, you never declare a "type" anywhere. You only need to provide the right kind of URL.

ℹ️

Data is never written to your WordPress database. TableCrafter is a viewer: it fetches on demand and caches the result in a transient using a Stale-While-Revalidate (SWR) strategy, so repeat page loads are served instantly while the source refreshes in the background.

Supported source types side by side

Use this table to pick the right source at a glance. The "URL pattern" column shows what triggers each loader.

Source typeURL patternReturnsCache TTLBest for
Remote JSON APIhttps://… (anything not matching the rules below)JSON array or nested object1 hourLive REST endpoints, third-party services
Local JSON fileStarts with your site/home/plugin URL, ends in .jsonJSON array1 hourSelf-hosted exports, static datasets you control
Remote CSV fileURL ending in .csvParsed rows (header = keys)1 hourExports from spreadsheets or BI tools
Local CSV fileLocal URL ending in .csvParsed rows1 hourUploaded files, demo data
Google SheetsAny docs.google.com/spreadsheets/d/… linkParsed rows (CSV export)1 hourNon-technical editors maintaining data in a sheet
Airtableairtable://baseId/tableNameFlattened records5 minutesStructured bases, linked records, attachments
⚠️

Remote URLs are screened for SSRF: requests to localhost and private/reserved IP ranges are blocked. A source like http://127.0.0.1/data.json or an internal 10.x address will be refused. Host your data on a publicly reachable URL or use a local file path under your WordPress install instead.

Remote JSON APIs

This is the default loader and the most common choice. Point source at any endpoint that returns a JSON array of objects. The server fetches the data for you, which means there are no browser CORS problems — the request never originates from the visitor's browser.

<!-- A flat JSON array at the top level -->
[tablecrafter source="https://api.example.com/products.json"]

If your API wraps the array inside a parent object, use the root attribute with dot notation to point at the array. The fetcher walks each segment of the path and returns the nested list.

<!-- Response shape: { "data": { "results": [ ... ] } } -->
[tablecrafter source="https://api.example.com/feed" root="data.results"]
AttributeRequiredNotes
sourceRequiredPublic HTTPS endpoint returning valid JSON. Validated as a URL and screened for SSRF.
rootOptionalDot-notation path to the array, e.g. items.list. A missing key returns a clear path error to admins.
ℹ️

The free version supports public APIs and key-in-URL APIs (where the API key is part of the query string). Header-based or OAuth authentication is not handled by the JSON loader.

Local JSON and CSV files

When the source URL begins with your site URL, home URL, or the plugin URL, TableCrafter resolves it to a file on disk and reads it directly — skipping the HTTP layer entirely. This is faster and avoids any loopback request issues.

<!-- A JSON file hosted in your uploads or plugin folder -->
[tablecrafter source="https://yoursite.com/wp-content/uploads/inventory.json"]

<!-- A local CSV file (header row becomes the columns) -->
[tablecrafter source="https://yoursite.com/wp-content/uploads/employees.csv"]

For safety the loader only reads files inside the WordPress root, the wp-content directory, or the plugin directory, and only when the file has a .json or .csv extension. Anything outside those whitelisted paths is ignored.

💡

In the admin builder you can use the Upload File (CSV/JSON) button to add a file and have its local URL filled in automatically. The bundled demos under demo-data/ (User Directory, Product Inventory, Sales Metrics, Employee List) are all loaded this way.

Google Sheets

Paste any Google Sheets share link directly into source. TableCrafter recognizes the docs.google.com/spreadsheets/d/… pattern, extracts the sheet ID, and rewrites it to the CSV export endpoint behind the scenes. If your link includes a gid (a specific tab), that tab is preserved.

[tablecrafter source="https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit#gid=0"]
💡

Google Sheets is the easiest source for non-developers: a marketing or ops teammate can edit the sheet, and the table updates on the next background refresh with no shortcode changes.

Airtable

Airtable uses a custom airtable:// URL so the plugin can connect to the Airtable REST API, page through all records, and flatten them for display. The format is:

airtable://{baseId}/{tableName}?token={pat}&view={viewId}
<!-- Inline token (key-in-URL style) -->
[tablecrafter source="airtable://appSampleBaseId/Employees?token=patXXXXXXXX"]

<!-- Using a saved token (recommended) -->
[tablecrafter source="airtable://appSampleBaseId/Employees?view=Grid%20view"]
PartRequiredNotes
baseIdRequiredYour Airtable Base ID (starts with app…). Parsed as the host of the URL.
tableNameRequiredTable name or table ID. Parsed as the first path segment.
tokenOptionalPersonal Access Token. If omitted, the saved encrypted token is used instead.
viewOptionalRestrict results to a named or ID view.

A Personal Access Token is always required to reach Airtable. You can either put it in the token query parameter, or save it once via the Airtable button in the admin builder — saved tokens are encrypted with AES-256 before being stored as the tablecrafter_airtable_token option and never appear in your shortcode. Records are normalized: each row's fields object is flattened, the record id is exposed as _airtable_id, and arrays (linked records, attachments) are collapsed to a readable string (the first attachment URL for images).

⚠️

Airtable enforces rate limits, so this source caches for only 5 minutes (versus 1 hour for other sources) and fetches at most 5,000 records (50 pages of 100). Plan for that ceiling on very large tables.

Choosing the right source

Configuring a source in the admin builder

You can build any of these without writing the shortcode by hand:

  1. Open WP Admin → TableCrafter (top-level menu, slug tablecrafter-wp-data-tables).
  2. Paste a URL into Data Source URL, or use Upload File (CSV/JSON), Google Sheets, or Airtable.
  3. For nested JSON, fill in Data Root (Optional) with the dot path (e.g. data.items).
  4. Preview the table, then copy the generated shortcode into any post, page, or the Gutenberg/Elementor block.

Regardless of source, the data is rendered into a .tablecrafter-container element that carries the configuration as data-source and data-root attributes, which the frontend script reads to hydrate the interactive table.

Error handling and caching

Every loader returns a structured error rather than a blank screen. Logged-in admins see a diagnostic helper (bad URL, missing root key, non-array structure, empty dataset, auth failure), while visitors see a graceful "Unable to load data" message. Successful fetches are cached in a transient and refreshed in the background once stale, so neither a slow API nor a temporary outage stalls your page render.

Next, see shortcode-reference.html for the full list of [tablecrafter] attributes, and airtable-integration.html for a step-by-step Airtable connection walkthrough.