Product Category Shortcodes

These two shortcodes will display your product categories on any page.

  • [product_category] – Will display products in a specified product category.
  • [product_categories] – Will display all your product categories.

Available Product Category attributes

↑ Back to top
  • ids – Specify product category ids listed. Used with [product_categories]
  • category – Can be either the category id, name or slug. Used with [product_category]
  • limit – The number of categories to display. Entering “0” or leaving undeclared shows all categories. (Interchangable with number as shown in example)
  • columns – The number of columns to display. Defaults to 4
  • hide_empty – The default is “1” which will hide empty categories. Set to “0” to show empty categories
  • parent – Set to a specific category ID if you would like to display all the child categories. Alternatively, set to “0” (like in the example below) to show only the top level categories.
  • orderby – The default is order by “name”, “id”, “slug”, or “menu_order” are additional options. If you want to order by the ids you specified then you can use orderby="include"
  • order – States whether the category ordering is ascending (ASC) or descending (DESC), using the method set in orderby. Defaults to ASC.

Examples of Product Category Scenarios

↑ Back to top

Show Top Level Categories Only

↑ Back to top

Imagine you only wanted to show top level categories on a page and exclude the sub categories, well it’s possible with the following shortcode.

[product_categories number="0" parent="0"]

Questions and support

↑ Back to top

Do you still have questions and need assistance? 

This documentation is about the free, core WooCommerce plugin, for which support is provided in our community forums on WordPress.org. By searching this forum, you’ll often find that your question has been asked and answered before.

If you haven’t created a WordPress.org account to use the forums, here’s how.

  • If you’re looking to extend the core functionality shown here, we recommend reviewing available extensions in the WooCommerce Marketplace.
  • Need ongoing advanced support or a customization built for WooCommerce? Hire a Woo Agency Partner.
  • Are you a developer building your own WooCommerce integration or extension? Check our Developer Resources.

If you weren’t able to find the information you need, please use the feedback thumbs below to let us know.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.