Posted on

WooCommerce Shortcodes to Display Product Categories

Want to display product categories anywhere on your WooCommerce site? Learn the exact shortcodes, parameters and use cases — plus how to bulk-manage categories faster.

WooCommerce categories shortcode

Last updated on June 17, 2026

Want to display WooCommerce product categories on a page, homepage, landing page, or sidebar?

WooCommerce includes built-in category shortcodes that let you display specific categories, top-level categories, or products from a category without writing custom code.

In this guide, you’ll learn:

  • The WooCommerce product category shortcodes
  • How to display specific categories
  • Useful shortcode parameters
  • Common shortcode examples
  • Troubleshooting tips
  • How to bulk-manage categories faster

WooCommerce product category shortcodes (quick reference)

Here’s a quick reference of the most commonly used WooCommerce category shortcodes:

Shortcode Purpose
[product_categories] Display all product categories
[product_categories parent="0"] Display only top-level categories
[product_categories ids="15,2,9"] Display specific categories
[product_category category="hoodies"] Display products from one category
[products category="hoodies"] Display products from a category with advanced filtering

What is a WooCommerce category shortcode?

A WooCommerce category shortcode is a built-in shortcode that lets you display product categories or category products anywhere on your store.

You can add these shortcodes to:

  • Pages and posts
  • Homepage sections
  • Landing pages
  • Widget areas
  • Custom layouts

For example, instead of manually linking categories, you can automatically display them using a shortcode and keep everything updated as your catalog changes.

WooCommerce product category shortcodes

WooCommerce provides two dedicated shortcodes for displaying categories and category products.

Display all product categories

Use:

[product_categories]

This shortcode displays your product categories in a grid layout. It’s useful for shop landing pages, category directories, and navigation pages where you want customers to browse categories before viewing products.

Display products from a specific category

Use:

[product_category category="hoodies"]

Replace hoodies with your category slug. This shortcode displays products from a single category and is commonly used for category landing pages, seasonal collections, and promotional campaigns.

Need more control? Use the [products] shortcode

The [products] shortcode is WooCommerce’s most flexible product display shortcode.

Example:

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

You can display products based on:

  • Category, SKU, or product IDs
  • Tags and attributes
  • Featured or sale products

It also supports additional controls for sorting, pagination, columns, and product limits.

Useful shortcode parameters

You can customize category displays using the following parameters:

Parameter Description Example
ids Display specific categories by ID [product_categories ids="15,2,9"]
limit Limit the number of categories displayed [product_categories limit="6"]
columns Set the number of columns [product_categories columns="3"]
hide_empty Hide categories with no products [product_categories hide_empty="1"]
parent Display only child categories of a parent category [product_categories parent="12"]
orderby Sort categories by name, ID, slug, or menu order [product_categories orderby="name"]
order Display categories in ascending or descending order [product_categories order="DESC"]

WooCommerce category shortcode examples

Display only top-level categories:

[product_categories parent="0"]
WooCommerce categories shortcodes

Display specific categories:

[product_categories ids="15,2,9"]

Display categories in a custom order:

[product_categories ids="15,2,9" orderby="include"]

Display only four categories:

[product_categories limit="4"]

Hide empty categories:

[product_categories hide_empty="1"]

Display products from a category:

[product_category category="electronics"]

Display products with advanced filtering:

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

How to add category shortcodes in WooCommerce

Once you’ve chosen a shortcode, adding it to your store is straightforward.

Using the block editor (Gutenberg)

  1. Open the page or post where you want to display categories or products.
  2. Click the + icon to add a block.
  3. Search for Shortcode.
  4. Add the Shortcode block.
  5. Paste your shortcode.
  6. Update or publish the page.

Using the classic editor

Simply paste the shortcode directly into the editor where you want the categories or products to appear. For example:

[product_categories parent="0"]

WooCommerce will automatically replace the shortcode with your category grid when the page loads.

WooCommerce category shortcodes not working? Try these fixes

If your category shortcode isn’t displaying correctly, the issue is usually easy to fix.

Problem Solution
Shortcode appears as plain text Use a Shortcode block instead of a Paragraph block
Categories don’t display Verify the category exists and contains products
Empty categories missing Set hide_empty="0"
Wrong categories showing Check category IDs and slugs
Layout looks broken Test with a default WooCommerce theme
Nothing displays Ensure WooCommerce is active and updated

Check your category slug

A common mistake is using the category name instead of the category slug. For example:

[product_category category="mens-clothing"]

Verify category IDs

If you’re using the ids parameter, make sure you’re using category IDs rather than product IDs. You can find category IDs under Products → Categories.

Managing WooCommerce product categories in bulk

Displaying categories with shortcodes is easy. Managing hundreds of categories and products is where things become time-consuming.

If your store has dozens or thousands of products, updating categories one product at a time can quickly become frustrating. This is where Smart Manager can help.

Instead of opening individual products, Smart Manager gives you a spreadsheet-style view of your WooCommerce store, making it easier to manage categories in bulk.

With Smart Manager, you can:

  • Bulk assign categories to products
  • Bulk remove categories
  • Move products between categories
  • Filter products by category
  • Update category-related product data in bulk
  • Make changes directly from a spreadsheet-like interface

Bulk-assign categories to new products

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
  • Under the Actions tab, 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!

    Try Smart Manager live demo

    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 one of the easiest ways to improve store navigation and help customers discover products faster. Whether you want to display all categories, feature selected collections, or build custom landing pages, WooCommerce provides built-in shortcodes that make the process simple.

For larger stores, combining category shortcodes with a bulk management tool like Smart Manager can save hours of manual work when organizing products and categories.

FAQ

What’s the difference between [product_categories] and [product_category]?

[product_categories] displays category listings, while [product_category] displays products from a specific category. Use the first when you want customers to browse categories and the second when you want to showcase products from a particular category.

How do I find a WooCommerce category ID?

Go to Products → Categories in your WordPress dashboard. Hover over a category or edit it to find its category ID. You can then use that ID in shortcodes:

[product_categories ids="15,2,9"]

Can I display WooCommerce subcategories only?

Yes. Use the parent parameter and specify the parent category ID:

[product_categories parent="12"]

This displays only the child categories belonging to the specified parent category.

Does the [products] shortcode replace older WooCommerce product shortcodes?

Yes. The [products] shortcode is WooCommerce’s most flexible product display shortcode and can replace many older product shortcodes by using filters such as category, tag, SKU, attributes, featured products, and sale products.

Can I display WooCommerce categories in a custom order?

Yes. Use the ids and orderby="include" parameters together:

[product_categories ids="15,2,9" orderby="include"]

WooCommerce will display categories in the exact order specified in the IDs list.

Can I display WooCommerce categories in multiple columns?

Yes. Use the columns parameter to control the layout:

[product_categories columns="3"]

This displays categories in a three-column grid.

Deeksha Paswan

About the Author – Deeksha Paswan

WooCommerce writer with 5+ years covering everything store owners actually deal with — products, inventory, offers, affiliates, and repeat sales. She turns complex plugin functionality into clear, actionable guidance that saves time and grows revenue. Off the clock, she’s either nurturing her garden or deep into an anime series.

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.