Product table columns

WooCommerce / Product Table

Columns decide what each product table shows, and in what order. Set them on the shortcode, in the Product Table block, or as the default under WooCommerce → Product Table → Table Defaults.

Built-in columns

List columns in the order they should appear. The built-in default, before you save Table Defaults, is image,name,summary,price,buy.

ColumnShows
idProduct ID. Linked when links are on.
skuSKU. Linked when the SKU is not empty and links are on.
nameProduct name, linked to the product page. Variation rows can use a different name format.
summaryShort description. Falls back to the full description. Trimmed to 15 words unless you change description_length.
descriptionFull description, also trimmed to description_length words.
imageThumbnail, or the parent image on a variation with no image of its own. Placeholder if there is no image.
priceWooCommerce price HTML, including sale price.
buyAdd to cart, or a checkbox when cart_button="checkbox".
buttonA “Show details” link to the product. Change the label with button_text.
categoriesLinked category names.
tagsLinked tag names.
stock“In stock”, a quantity such as “12 in stock”, or “Out of stock”.
datePublished date. Format with date_format, using a PHP date format.
weightProduct weight, with the store weight unit.
dimensionsLength × width × height.

Image, buy, and the details button cannot be sorted by clicking the heading. Every other column can.

Custom headings

Rename a built-in heading with column:Heading. The name before the colon is still the column. The text after it is only the heading.

[yh_wc_product_table columns="sku:Code,name:Item,price:Cost,buy:Add"]

Custom fields, attributes, and taxonomies

PrefixExampleShows
cf:cf:warrantyOne text custom field (post meta) for that key.
att:att:colorA product attribute. Use the slug, not the label, and do not add pa_.
tax:tax:product_brandTerms from a custom taxonomy, separated by commas.
[yh_wc_product_table columns="image,name,cf:warranty,att:color,tax:product_brand,price,buy"]

A custom field column prints a single text value. Serialized data, images, and repeaters come out blank or as raw text. The meta key is read in lowercase, so cf:Brand will not match Brand.

Headings for these columns are the name after the prefix, such as “color” or “warranty”. Custom column:Heading names are for the built-in columns above.

Images and long text

AttributeDefaultNotes
image_size70x70Pixels, such as 150x150, or a named size such as thumbnail or woocommerce_thumbnail.
lightboxtrueClick the thumbnail to open a larger image. Set false to turn that off.
description_length15Word count for summary and description. -1 shows the full text. 0 shows nothing.
shortcodesfalseRun shortcodes inside the summary and description, and skip the word trim.
wraptrueLet long cell text wrap. false keeps it on one line.

links defaults to all. Product name, SKU, ID, categories, and tags link through. links="none" prints plain text. Or pass column names, such as links="name,sku".

Hide columns from guests

Logged-out visitors lose any column listed in hide_columns_guest. Logged-in customers still see them. If that would remove every column, the table keeps the name column.

[yh_wc_product_table columns="sku,name,price,buy" hide_columns_guest="price,buy"]

Column width

Set a width per column with column_widths. Use a percentage or a CSS length. The key is the column name, without a custom heading.

[yh_wc_product_table columns="image,name,sku,price,buy" column_widths="name:40%,sku:90px,price:110px"]

Common mistakes

Quantity in the column list

quantities is not a column. columns="name,quantities,buy" adds an empty column headed “Quantities”.

Fix: Keep buy in the column list and add quantities="true" as its own attribute.

Custom field column is blank

The column reads one meta value on the product, using the key exactly, in lowercase.

Fix: Check the meta key in the database or with a fields plugin. Use cf:my_field, not the field label. Variation rows read the variation’s own meta, not the parent’s.

Attribute column is blank

The slug does not match the attribute, or the product has no value for it.

Fix: Use the attribute slug from Products → Attributes, for example att:color. Global attributes are stored as pa_color. Leave the pa_ off in the shortcode.