Posted on

WooCommerce Shortcodes to Display Product Categories

Want to display product categories anywhere on your WooCommerce site? Learn how to use category shortcodes to make it happen—fast and easy!

WooCommerce categories shortcode

Last updated on June 24, 2025

Ever felt like your online store’s navigation is one awkward click away from chaos? Yeah, we’ve all been there. When your product categories aren’t displayed clearly, shoppers get confused—and confused shoppers don’t convert.

That’s where WooCommerce category shortcodes come in. These bite-sized bits of code make it ridiculously easy to showcase product categories anywhere—on pages, posts, or wherever you need them most.

They’re simple to use, endlessly flexible, and let you control exactly what shows up and how it’s organized. It’s like giving your store a GPS… for your customers.

In this blog, we’ll walk you through the exact shortcodes you need to display product categories like a pro—minus the coding headache.

All the WooCommerce shortcodes (Yes, Every. Single. One.)

If you’re thinking, “There has to be an easier way to display all these WooCommerce features without digging into code,”—you’re absolutely right. And guess what? Shortcodes are your secret weapon.

Whether you’re building your site with the Classic Editor or flexing your design skills in the Block Editor, shortcodes let you drop in powerful WooCommerce elements wherever you want—with just a tiny bit of code.

  • Want to shortcode for cart? Use [woocommerce_cart].
  • Need the checkout shortcode? Pop in [woocommerce_checkout].
  • Want users to access their account? You guessed it— [woocommerce_my_account].

And that’s just scratching the surface.

We’ve put together an easy-to-follow blog post that covers all the essential WooCommerce shortcodes—what they do, how to use them, and which ones work best for different pages or strategies.

Now, shifting gears—here’s how you can use shortcodes to display product categories like a pro.

Two handy WooCommerce product category shortcodes

Want to show your product categories on any page? WooCommerce gives you two simple shortcodes to do that:

  • [product_category] – This shows products from one specific product category.
  • [product_categories] – This displays all your product categories. Want to show just one or a few? You’ll need to add some extra info, called parameters (don’t worry, it’s easy!).

Now, let’s talk about the MVP of shortcodes…

The powerful [products] shortcode

This one’s a game-changer. With [products], you can show products based on all sorts of filters—like category, SKU, attributes, ID, and more.

You can also control how they’re sorted, how many show up, and whether to use pagination.

It’s so flexible that it replaced several older shortcodes, like:

  • [sale_products]
  • [best_selling_products]
  • [recent_products]
  • [featured_products]
  • [top_rated_products]
  • [product_attribute]

All of that? Now done with just [products]. Yep, way simpler.

To use parameters, just place them inside the shortcode, like this:

[products limit="3" category="electronics"]

This will display 3 products from the electronics category.

Useful attributes for category shortcodes

Here are some extra settings (aka attributes) you can use to customize how your product categories are shown:

  • ids – This attribute displays specific categories by their ids. To be used in product_categories. For example – [products _categories ids="1,2"].
  • category – This can be either the category name, id, or slug. To be used in [product_category].
  • limit – This controls the number of categories that will be displayed. For example – [products _categories limit="5"].
  • columns – This attribute determines the number of columns that will be displayed. The default is 4.
  • hide_empty – Use this to hide empty categories. The default value “1” will hide empty categories. If you use “0”, it will show empty categories. For example – [products _categories hide_empty="1"].
  • parent – This will display child categories of a specific parent category, which is targeted by id. For example, [parent="2"] will display the child categories of the category whose id is 2. If you set parent to “0”, then only the top-level categories will be displayed. Example – [products _categories parent="0"].
  • orderby – This attribute controls the display order of categories. The default is to order by “name”. It can be set to “id”, “slug”, or “menu_order”. If you want to display categories in order by ids you specified, then you can use orderby=”include”. For example – [products _categories orderby="id"].
  • order – states whether the category order is ascending (ASC) or descending (DESC), using the method set in orderby. The default is ASC. For example – [products _categories order="ASC"].
  • Example of product category scenarios

    Let’s say you want to show only your top-level categories to your visitors and exclude the sub-categories.

    So, the shortcode will be [product_categories number="0" parent="0"].

    WooCommerce categories shortcodes

    You can also use additional parameters to customize the output. Here are some examples:

    • [product_categories parent="0"] // Display top-level categories only
    • [product_categories number="3"] // Display 3 categories only
    • [product_categories orderby="name" order="desc"] // Order by name in descending order
    WooCommerce categories shortcodes

    Troubleshooting WooCommerce shortcodes

    Sometimes shortcodes just don’t play nice—and it’s usually due to a small oversight. Here’s a quick checklist to help you troubleshoot:

    • You’re using straight quotes (“) instead of curly ones (“ ”): Curly quotes may look fancy, but they break your shortcode. Stick with the basics!
    • You’ve placed the code inside a Shortcode block: If you’re using the Block Editor, make sure the shortcode is added using the dedicated Shortcode block—not just pasted in a paragraph.
    • WooCommerce is installed and up-to-date: Outdated or missing plugins can easily cause shortcodes to misbehave.
    • No conflicts with your theme or plugins: Temporarily deactivate other plugins or switch to a default theme to check if something’s interfering.

    Don’t worry—shortcodes are tiny but mighty, and they usually just need a bit of tweaking to work their magic.

    How to manage product categories with Smart Manager?

    Managing categories for a handful of products is simple. However, when handling a large inventory, manually updating each item can be time-consuming and inefficient.

    That’s where Smart Manager proves invaluable—allowing you to assign or remove product categories in bulk with just a few clicks, streamlining your workflow and eliminating the need for repetitive tasks.

    Let’s say you’ve just added 20 new T-shirts to your store—half are for men, half for women. Instead of editing each one manually, here’s how you can bulk-assign them to the right categories using Smart Manager:

    • Head over to WordPress Admin > Smart Manager
    • From the dropdown, choose Products
    • Select all the T-shirts you want to edit
    • Click on Bulk Edit
    • In the slide over panel, set the field to Category.
    • Choose what you want to do:
      • Set To (replaces all existing categories)
      • Add To (adds a new one while keeping the rest)
      • Remove From (removes a specific category)
    • For example, choose add to > Men’s Fashion
    • Choose whether to bulk update now or later and Update.
    • All your T-shirts are now categorized correctly. Smart Manager makes bulk edits a breeze, even on your busiest days!

      How to edit products based on category?

      Let’s say you want to update prices for all Clothing items. Here’s how to do it using Smart Manager:

    1. In Smart Manager, select Products
    2. Enable Advanced Search
    3. Filter by Category = Clothing
    4. Click Search
    5. Use the header checkbox to select all results in one go
    6. Bulk edit the filtered products just like before — update prices, stock, status, etc.

    That’s it—bulk editing made easy! To know more about bulk editing attributes, check out this blog.

    Conclusion

    WooCommerce category shortcodes are a simple yet powerful way to organize your store and guide customers to what they’re looking for—faster.

    By using them smartly, you not only improve navigation and user experience but also save yourself the hassle of manually creating category lists.

    We hope this guide cleared things up for you! Got questions, tips, or shortcode stories to share? Drop them in the comments—we’d love to hear from you.

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.