The [coretable] Shortcode
The [coretable] shortcode shows a published dataset anywhere shortcodes work: classic themes, the Shortcode widget, page builders and template files. It renders the same table and chart as the blocks.
Get the Shortcode
On the Datasets screen, the Embed column shows each dataset’s shortcode, such as [coretable id=12]. Select Copy shortcode in the Actions column to copy it.
A dataset gets its shortcode once it’s published. Before that, the column reads “Available after publication”.
Attributes
| Attribute | Values | Default | Notes |
|---|---|---|---|
id | The dataset ID | Required | Missing or wrong IDs render nothing |
type | table or chart | table | |
caption | Any text | The dataset name | |
pagination | yes | Off | Off shows every row |
per_page | 1 to 100 | Site setting, 10 | Only used with pagination=yes. Charts cap it at 50 |
search | no | On | Tables only |
sort | no | On | Tables only |
sticky | yes | Off | Tables only |
layout | scroll, cards, cards-tablet | scroll | Tables only |
filters | yes | Off | Tables only. Exact-match column filters |
download | yes | Off | Tables only. Also needs CSV downloads allowed on the dataset |
chart | bar or line | bar | Charts only |
label | A column key | Automatic | The chart’s category column |
value | A column key, or a list such as "a,b,c" | Automatic | The chart’s series, up to 6 |
axis | Any text | Automatic | The chart’s value axis label |
preset | clean, striped, bordered | Site setting | Table style |
density | compact, comfortable, spacious | Site setting | Row spacing |
radius | none, small, round | Site setting | Corner shape |
accent | A 6-digit hex color | Site setting | Accent color |
On and off attributes also accept true, 1, false and 0.
The layout values match the block: cards stacks rows on phones, and cards-tablet stacks them on phones and tablets.
Column Keys
label and value need column keys, not labels. You’ll find each key under its Column label in the dataset editor’s Columns tab.
Keys are lowercase, start with a letter and use underscores, such as monthly_price. They never change when you rename a column.
Examples
A basic table:
[coretable id=12]
A paged table with a caption and a CSV button:
[coretable id=12 pagination=yes per_page=20 download=yes caption="Course comparison"]
A table without search or sorting, with a sticky header and stacked rows on phones:
[coretable id=12 search=no sort=no sticky=yes layout=cards]
A table with filters and its own style:
[coretable id=12 filters=yes preset=striped density=compact radius=round accent="#d63638"]
A bar chart of one column:
[coretable id=12 type=chart label=title value=price]
A line chart with 3 series and an axis label:
[coretable id=12 type=chart chart=line label=year value="wordpress,shopify,wix" axis="Share of websites (%)"]
Things to Know
- Only published public data shows. Private columns never appear, even if you name them in
value. - Unusable series are skipped. When you list several keys, any that aren’t public number or currency columns are left out. If none are usable, the chart shows “Chart columns are unavailable.”
- A bad style value falls back to the site setting on its own. The shortcode’s other style overrides still apply.
- Chart pagination with no
per_pageuses the site’s Default rows per page for shortcodes, which is 10, not the block’s 50. Setper_pageyourself for charts. - The download button needs Allow visitors to download public columns as CSV on the published dataset as well as
download=yes.
Appearance Settings explains the style values, and The Core Chart Block explains how charts use label, value and axis.
For step-by-step walkthroughs, see How to Add a Chart with Several Series to a WordPress Post and How to Move Your TablePress Tables to Core Tables.