Product table columns

Our WooCommerce Product Table WordPress plugin lists your products in a table, with columns of information about each product. You can use the columns option to choose which columns to include in the table.

Available columns

The available columns are: sku, id, name, description, short-description, date, categories, tags, image, reviews, stock, weight, dimensions, price, add-to-cart, and button. You can also add columns for any product attribute, custom field or custom taxonomy term. If you’re using WooCommerce Product Table with our WooCommerce Quick View Pro plugin, then you can also add a quick-view column.

You can choose as many columns as you want and in any order:

The sku and name columns are self-explanatory. The id column is the product ID, assigned by WordPress when you create the product.

The description column will show the full product description, shown under the “Description” tab on the product page. The description is truncated to 15 words but you can customise this using the description_length option.

The short-description column will display the Product Short Description entered on the Edit Product screen. The is normally displayed on your product page just before the price and add to cart button.

The date column will display the date that the product was added to your store (i.e. when it was published).

The categories and tags columns display the list of categories/tags that the product is in. You can use the links option to control whether or not these columns will link to the relevant category or tag. If search_on_click is enabled then clicking on the category or tag in the table will filter the table to products in that category/tag.

The image column will display the main product image (see the image_size option below to set a custom size).

The reviews column will display the average star rating out of 5 for each product, based on previous customer reviews.

The stock column will show the current stock level for the product. There are various settings in WooCommerce which control how the stock level is displayed (see WooCommerce > Settings > Products > Inventory), and this column will change based on these settings.

The weight and dimensions columns will display the relevant data as entered for each product under the Shipping tab.

The price column will display the current product price. If there are variations for the product then the price is displayed as a range – e.g. “$2.99 – 5.99”. If the product is currently on sale, then the sale price is shown with the original price crossed out next to it.

The button column will display a button in the table which links to the product detail page.

The quick-view column adds ‘Quick View’ buttons to the product table. This column is only available if you are also using our WooCommerce Quick View Pro plugin. You can rename the buttons and add or remove an icon on the Quick View Pro plugin settings page. (Learn more about using the two plugins together.)

Please note that column names are case sensitive and should always be lower case. (If you’re using custom column headings then these can be any case.)

Option 2 - Use the shortcode option to set columns for specific tables

Option 2 - Use the shortcode option to set columns for specific tables

You must separate each column with a comma. It doesn’t matter if there are spaces before or after the comma.

For example, let’s say you wanted to create a product table with columns for product name, categories, stock level, price and add to cart button. To do this, you would either:

Add name,categories,stock,price,add-to-cart to the Columns field on the plugin settings page, or;

Use the following shortcode: [product_table columns="name,categories,stock,price,add-to-cart"]

Product attribute columns

You can display any product attribute as a separate column in the table using the format att:<attribute name>. Here’s an example with columns for the attributes color and size:

[product_table columns="name,att:color,att:size,add-to-cart"]

You need to use the attribute “slug” here, which can be found under the Products -> Attributes menu in the WordPress admin.

Product table with attribute columns for color & size

Should I use global or product-specific attributes?

We generally recommend adding your attributes globally under Products -> Attributes and then selecting them for each product. This is because global attributes are easier to use for multiple products, and you can only have filter dropdowns for global attributes.

If you want to show a custom product attribute (i.e. an attribute added just for one product), use the attribute name you entered on the Attributes tab for that product. You can display this as a column in the product table, and (unless you’re using lazy load), customers can click on a column header to sort by that column.

Custom field columns

You can also add custom fields to your table using the format cf:<field name>. This is a good way to store extra data within custom columns in the product table. If you haven’t created your custom fields yet, please see this article.

If you are using Advanced Custom Fields, the field name can be found under the “Field Name” column in the Custom Fields menu. Here’s an example adding two custom fields – product_meta and product_expiry:

Custom fields are an opportunity to include other types of content in the table. You can use them to store various data such as links, buttons, icons and shortcodes from other plugins. You will need to add the full HTML code or shortcode to the custom field so that the product table can display it correctly. If you’re using shortcodes, you will need to set shortcodes to true.

Tip: If you haven’t created your custom fields yet, we recommend the free Advanced Custom Fields plugin. Create the custom fields, and then you can display them as columns in the product table.

Product table with a custom field called ‘Link’ containing links, icons & buttons

Custom fields created using the Toolset Types plugin

If you’re using Toolset Types to create your custom fields, then you need slightly different syntax to display them in the product table.

Toolset adds wpcf- to the start of the custom field name, so if you create a custom field called ‘link’ (for example) then the correct syntax will be wpcf-link. This means that if you want to create a product table with columns for name and a custom field called ‘link’ then you would need to add it as follows:[product_table columns="name,cf:wpcf-link"]

ACF repeater fields

If you’re using Advanced Custom Fields Pro repeater fields, you can create a column using the name of the parent repeater field. This column will list the content of all the repeater fields for that product, separated by commas. It is not possible to display repeater sub-fields as separate columns in the table.

Custom taxonomy columns

To add taxonomies to your table (other than product categories and tags), use the format tax:<taxonomy slug> in the columns option. This will display a custom taxonomy in a column of your product table.

So, for example, to display for a custom taxonomy with the slug document_type, you would use:[product_table columns="name,description,tax:document_type"].

You can find the taxonomy slug by going to the WordPress admin and finding the page which lists the taxonomy terms. For example, WooCommerce product categories are edited under the Products -> Categories menu. On that page, the URL at the top of the screen shows “…edit-tags.php?taxonomy=product_cat….” The ‘product_cat’ part after the equals (=) is the taxonomy slug you need to use.

Stock column

The stock column will either contain the basic stock status (e.g. ‘In Stock’ or ‘Out of Stock’) or the exact stock level. This is controlled in the main WooCommerce stock settings – WooCommerce > Settings > Products > Inventory. This page contains options on whether you wish to display the overall stock status or the exact stock quantity for each product.

‘Total sales’ column

WooCommerce has a custom field called total_sales which stores the total number of sales for each product. You can display this as a column in the table by using cf:total_sales in the columns option.

How to display the sale price

By default, the sale price for your WooCommerce products will appear in the main ‘price’ column. The usual price will be crossed out and the sale price will be shown.

If you like, you can also display the sale price in its own column. The sale price in WooCommerce is a custom field called cf:_sale_price. This means that you can display the sale price as a custom field column (see instructions above). For example, your shortcode might be: [product_table columns="name,cf:_sale_price,add-to-cart"]

Choosing your own column headings

You can set custom column headings by adding a : (colon) after the column name. This works whether you’re listing columns on the plugin settings page, or directly in the shortcode. You can add custom headings for any column in the table. If you don’t set one then the default heading will be used.

For example:

The default heading for the product name is “Name”, but if you wanted the heading “Product Name” instead, you would use:[product_table columns="name:Product Name,date,price"]

You can rename the ‘Buy’ column to ‘Choose options’ like this: [product_table columns="name,add-to-cart:Choose Options"]