Website Building » WooCommerce » How Do I Get Product Category in WooCommerce?

How Do I Get Product Category in WooCommerce?

Last updated on October 1, 2022 @ 1:12 pm

If you’re running a WooCommerce store, you’ve probably noticed that there’s no default way to display product categories on your site. This can be a bit of a problem if you’re trying to promote certain products or categories of products, because users won’t be able to tell at a glance what’s available.

The good news is that there are a few ways to add product categories to your WooCommerce store. Let’s take a look at three of the most popular methods.

Method 1: Use the WooCommerce Product Categories Widget

The easiest way to add product categories to your WooCommerce store is to use the WooCommerce Product Categories widget. This widget is included with WooCommerce and can be added to any sidebar.

To use the WooCommerce Product Categories widget, simply go to your WordPress dashboard and navigate to Appearance > Widgets. Find the WooCommerce Product Categories widget and drag it into one of your sidebars.

You can then configure the widget to show the product categories you want. By default, it will show all top-level categories, but you can change this by selecting a different option from the drop-down menu.

Method 2: Use the Product Categories Shortcode

If you don’t want to use a widget, you can also add product categories to your WooCommerce store using a shortcode. WooCommerce comes with a built-in [product_categories] shortcode that can be used anywhere on your site, including in posts, pages, and text widgets.

To use the [product_categories] shortcode, simply add it to any post or page where you want the product categories to appear. By default, it will show all top-level categories, but you can change this by adding one or more of the following parameters: ids, parent, hide_empty, orderby, and order.

For example, if you only want to show subcategories of a specific category, you would use something like this: [product_categories parent=”123″]. Or if you wanted to show all categories except for one specific category, you would use this: [product_categories exclude=”123″].

Method 3: Use a Third-Party Plugin

If you don’t want to use a widget or shortcode, another option is to install a plugin that adds product categories to your WooCommerce store. There are quite a few plugins available that serve this purpose, so it’s just a matter of finding one that fits your needs.

One plugin that we recommend is called YITH WooCommerce Category Accordion. This plugin lets you display all of your product categories in an accordion menu on any page or post on your site. It’s easy to set up and use, and it comes with some handy features like the ability to exclude certain categories from being shown.

Once you’ve installed and activated the plugin, simply go to any post or page and click on the YITH Category Accordion button in your editor toolbar. This will insert a shortcode into your post or page where you want the accordion menu to appear. You can then configure the plugin settings from the WordPress dashboard under YITH > Category Accordion.

Whether you use a widget, shortcode, or plugin, adding product categories to your WooCommerce store is fairly easy and straightforward. So if you’re looking for an easy way to promote certain products or groups of products on your site, one of these methods should work for you.

How Do I Get Product Category in Woo Commerce?

There are many ways that you can get product category in Woo Commerce.

You could use a plugin,

the built in WordPress editor,

or even just simple HTML and CSS.

Each method has its own benefits and drawbacks.

How do I get product category in Woo Commerce?

It really depends on what method best suits YOUR needs.

PRO TIP: If you are looking for a way to get product categories in WooCommerce, beware that this method is no longer supported and may not work as expected. Use another method to get product categories in WooCommerce.
Dale Leydon

Dale Leydon

Sysadmin turned Javascript developer. Owner of 20+ apps graveyard, and a couple of successful ones.