How to choose which products appear in the table
WooCommerce Product Table comes with lots of options for choosing which products are included or excluded in the table. You can display products with a specific category, tag, custom taxonomy term, custom field, date (year, month or day) or status. You can also show or hide specific products from the table based on their ID, and exclude certain categories.
Select the following options from the "Which products?" section of the table builder at Products → Product Tables.
Category
Display products from a specific category (or subcategory).
Tip: Another way to create tables listing products from a specific category is to enable the product table on the category page template. This avoids having to create a separate table for each category.
Can I list categories and sub-categories separately?
All products are displayed in a single list, regardless of whether they are in a parent category or child category.
If you want to list products separately based on their category, then we recommend adding multiple tables to the page. Each table should list products from a different category or subcategory. You can divide up the page by adding the category name as a subheading above each table.
Tag
Display products based on their tags.
Custom field
Display products with a certain custom field value. To do this, select 'Custom field' and enter the name of the custom field along with the value that you wish to display. For example, you might enter the custom field "color" and the value "blue".
Note: If you're using the Toolset plugin to create your custom fields, then you need to prefix the custom field name with wpcf-
.
Custom taxonomy term
Display only products which have the specified term or terms. The taxonomy that you are selecting from doesn’t have to be a column in your table.
All of the taxonomies for your products will appear in the list for you to select from. Once you select a taxonomy, you should select the term(s) that you wish to display the products for.
Displaying number-based taxonomy terms
By default, WooCommerce Product Table works with text-based custom taxonomy terms, e.g. 'coats' or 'shoes'. If you are using numeric taxonomy terms (e.g. "123" and "456"), then you need to add numeric_terms="true"
to the shortcode when you insert the table onto a page. For example:[product_table id="1" numeric_terms="true"]
Attribute
List products with a specific attribute value. All the global attributes added via Products → Attributes will appear in the list, and then you can select specific terms for the selected attributes.
Note: This option works by looking at which attributes are attached to each product. If you are using it to display variable products, then it will list all variations for the product, and not just the ones that have these attributes. If you're using the separate variations option and want to create a table listing specific variations based on their attributes, then the only way to do this is to use option 2 of these instructions to link to a pre-filtered table based on those attributes.
Display products by date
List products based on the date they were published.
Product status
List products based on their post status. The options are Any, Published, Scheduled, Draft, and Pending.
Pending products are those pending a review. Future posts are those scheduled to be published at a future date. Private posts have their visibility set to Private which means they can only be viewed by the original author or other administrators.
See also: How to automatically expire products and remove them from the table on a certain date.
Stock status
By default, WooCommerce Product Table lists products with any stock status. The stock option lets you display products based on their stock status. The available options are In Stock, Out of Stock, and On Backorder.
Individual products
Select one or more specific products to display.
Excluding products from the table
You can exclude certain products or categories from the table by adding extra parameters to the shortcode. For example, if the ID of your table is "1" then you can do it like this:
[product_table id="1" exclude="23,78"]
will exclude products with the ID's 23 and 78. You can find the ID by going to the main list of products in the WordPress admin and hovering over a product name. Note that the 'Individual Products' option and the 'Exclude' shortcode option and are mutually exclusive, so if you have selected individual products to appear in your pre-built table then the exclude option will be ignored.[product_table id="1" exclude_category="3,6"]
will exclude all products that are in categories with the ID's 3 or 6, and their subcategories. You can use category IDs or slugs.
Additional ways to select products
Products previously ordered by current user
You can use WooCommerce Product Table to list products that the current logged in user has previously purchased. Simply add user_products="true"
to the shortcode, for example:
[product_table id="1" user_products="true"]
When using this option, we generally recommend adding the table to a page that is only visible to logged in users. Our tutorial contains advice on how to add it to the WooCommerce Account page or to another hidden page.
Read our tutorial about how to display the user's previously ordered products.
Featured products
You can create table listing featured products by adding term="product_visibility:featured" to the shortcode. This will display products that you have marked a 'Featured' on the Add/Edit Product screen.
For example: [product_table id="1" term="product_visibility:featured"]
List variations for a specific product only
You may wish to create a product table listing the variations for a specific product. For example, this might be useful if you wanted to add a table of variations to the single product page for each product.
You can do this by using the option to List each variation on its own row and also using the 'Individual products' option described above to select the product whose variations you wish to display.
See this shortcode in action on this product on our demo site. We also have a separate article with more guidance on showing product tables on the single product page.
Show bestselling or popular products
It's also possible to create product tables listing your most popular or bestselling products, based on the number of sales. Please see our full tutorial on how to do this.
Show 'on sale' products
Unfortunately there's no automatic way to show discounted/sale products in the table. This is because WooCommerce doesn't store this information as a taxonomy or custom field that you can display using WooCommerce Product Table.
Here are two suggested workarounds:
- Mark your reduced price products as 'featured' and use these instructions to list them in the table.
- If you want to use featured products for something else, then you could also create a custom taxonomy (instructions here) and use it to tag products that are on sale. You can then create a table listing products with the "On sale" taxonomy term.
Show products with a specific price
WooCommerce Product Table doesn't have a feature to list products based on price. However, you can achieve something similar by using the price filter that comes with the plugin.
Instead of linking to a normal page with a product table, you need to link to the URL of a table that is pre-filtered by price. There are instructions on how to do this in this article.
Choosing between 'AND' or 'OR' logic
By default, the plugin uses 'or' logic so that products will be displayed if they match any of the selected categories/tags/etc.
To use 'and' logic instead so that products must match all the selected categories/tags/etc., simply enable the "Products must match all values" which appears when more than one category/tag/etc. is selected.