WooCommerce Product Shortcode

WooCommerce Product Shortcode – A Comprehensive Guide (2026)

WooCommerce product shortcodes let you display products anywhere on your WordPress site using simple commands like [ products].

You can use them to show featured products, sale items, best sellers, latest products, category-based products, product grids, product categories, and add-to-cart buttons without writing PHP code.

In this guide, you’ll find the most useful WooCommerce product shortcode examples, common [ products] shortcode parameters, advanced filtering examples, troubleshooting tips, and FAQs.

Quick Answer: What Is the Main WooCommerce Product Shortcode?

The main WooCommerce product shortcode is:

[products]

You can customize it with parameters like limit, columns, category, tag, skus, ids, on_sale, best_selling, top_rated, visibility, orderby, and order.

Example:

[products limit="8" columns="4" category="hoodies"]

This shortcode displays 8 products from the hoodies category in 4 columns.

WooCommerce’s official documentation lists [ products] as the main shortcode for displaying products by specific parameters.

Most Useful WooCommerce Product Shortcodes

GoalShortcode
Show 8 products in 4 columns[ products limit=”8″ columns=”4″ ]
Show products from a category[ products category=”hoodies”]
Show sale products[ products on_sale=”true”]
Show best-selling products[ products best_selling=”true”]
Show featured products[ products visibility=”featured”]
Show top-rated products[ products top_rated=”true”]
Show latest products[ products orderby=”date” order=”DESC”]
Show products with pagination[ products limit=”12″ columns=”4″ paginate=”true”]
Show products by ID[ products ids=”101,105,120″]
Show products by SKU[ products skus=”woo-tshirt-logo,woo-hoodie”]
Show product categories[ product_categories]
Show a full single product page[ product_page id=”99″]
Show add to cart button[ add_to_cart id=”99″]

How to Add WooCommerce Product Shortcodes in WordPress

You can add WooCommerce product shortcodes to pages, posts, widgets, and page builders.

Add Shortcodes in the Block Editor

To add a shortcode in the WordPress block editor:

  1. Open the page or post.
  2. Click the plus icon.
  3. Search for the Shortcode block.
  4. Paste your shortcode.
  5. Update or publish the page.

Example:

[products limit="4" columns="4"]

Add Shortcodes in Elementor or Other Page Builders

Most page builders support shortcodes.

In Elementor:

  1. Search for the Shortcode widget.
  2. Drag it into your section.
  3. Paste your WooCommerce shortcode.
  4. Update the page.

Example:

[products best_selling="true" limit="8" columns="4"]

Add Shortcodes in Sidebar Widgets

To add WooCommerce shortcodes in a sidebar:

  1. Go to Appearance → Widgets.
  2. Add a Shortcode block or Text block.
  3. Paste your shortcode.
  4. Save the widget.

Example:

[products on_sale="true" limit="4"]
CTX Gif Banner

WooCommerce [ products ] Shortcode Parameters

The [ products ] shortcode can display products by ID, SKU, category, tag, attribute, visibility, sale status, rating, popularity, and more. WooCommerce documents special product attributes such as best_selling, on_sale, and top_rated, along with filtering options like categories, tags, attributes, and operators.

Here are the most useful parameters:

ParameterWhat It DoesExample
limitControls how many products appear[ products limit=”6″ ]
columnsControls the number of product columns[ products columns=”4″ ]
categoryShows products from specific category slugs[ products category=”hoodies” ]
tagShows products with specific product tags[ products tag=”summer” ]
idsShows specific products by product ID[ products ids=”12,34,56″ ]
skusShows specific products by SKU[ products skus=”sku-1,sku-2″ ]
orderbySorts products by date, title, price, popularity, rating, etc.[ products orderby=”date” ]
orderSets ascending or descending order[ products order=”DESC” ]
paginateAdds pagination[ products paginate=”true” ]
on_saleShows sale products[ products on_sale=”true” ]
best_sellingShows best-selling products[ products best_selling=”true” ]
top_ratedShows top-rated products[ products top_rated=”true” ]
visibilityShows products by catalog visibility[ products visibility=”featured” ]
attributeShows products by product attribute[ products attribute=”color” terms=”blue” ]
termsWorks with attribute to define attribute terms[ products attribute=”size” terms=”large” ]

Here are the most useful parameters:

Important: Avoid using on_sale, best_selling, and top_rated together in the same shortcode. WooCommerce notes that these special product attributes may conflict when combined.

WooCommerce Product Shortcode Examples by Use Case

Now let’s look at the most practical WooCommerce product shortcode examples.

Display All Products in WooCommerce

To display all products, use:

[products]

For most stores, it is better to limit the number of products:

[products limit="12" columns="4"]

This displays 12 products in a 4-column grid.

Display Products by Category

To display products from a specific category, use:

[products category="hoodies"]

To control the layout:

[products category="hoodies" limit="8" columns="4"]

To show products from multiple categories:

[products category="hoodies,t-shirts" limit="8" columns="4"]

Use the product category slug, not the full category name.

Display Featured Products

To display featured products in WooCommerce, use:

[products visibility="featured"]

For a homepage or landing page section:

This is useful for highlighting hand-picked products.

Display Sale Products

To display products that are currently on sale, use:

[ products on_sale=”true” ]

For a sale section:

[products on_sale="true" limit="8" columns="4"]

This is useful for creating “Sale,” “Deals,” or “Special Offers” sections.

Display Best-Selling Products

To show best-selling WooCommerce products, use:

[products best_selling="true"]

For a cleaner layout:

[products best_selling="true" limit="8" columns="4"]

This can work well on homepages, product recommendation sections, and campaign pages.

Display Latest Products

To show the newest WooCommerce products, sort products by date in descending order.

[products orderby="date" order="DESC"]

For a new arrivals section:

[products orderby="date" order="DESC" limit="8" columns="4"]

Display Top-Rated Products

To display top-rated products, use:

[products top_rated="true"]

Example:

[products top_rated="true" limit="4" columns="4"]

This helps promote products with strong customer ratings.

Display Products by SKU

To show specific products by SKU, use:

[products skus="woo-tshirt-logo,woo-hoodie"]

You can also control the layout:

[products skus="product-001,product-002,product-003" columns="3"]

This is useful when you know the exact products you want to display.

Display Products by Product ID

To show products by product ID, use:

[products ids="12,34,56"]

Example with columns:

[products ids="12,34,56" columns="3"]

You can find the product ID from Products → All Products in your WordPress dashboard.

Display Products by Tag

To display products with a specific tag, use:

[products tag="summer"]

For multiple tags:

[products tag="summer,new-arrival" limit="8" columns="4"]

Tags are useful for seasonal collections, campaign products, or custom product groups.

Display Products with Pagination

To add pagination, use:

[products limit="12" columns="4" paginate="true"]

This displays 12 products per page with pagination.

Display Products by Attribute

To display products by attribute, use the attribute and terms parameters.

Example:

[products attribute="color" terms="blue"]

For a black product collection:

[products attribute="color" terms="black" limit="8" columns="4"]

You can use this for color, size, brand, material, style, or any product attribute.

WooCommerce explains that product attributes can be used to filter and display products based on assigned characteristics such as color or size.

Display a Single Product Page

To display a full single product page inside another page or post, use:

[product_page id="123"]

You can also use SKU:

[product_page sku="woo-tshirt-logo"]

WooCommerce lists as a shortcode that displays a full single product page by ID or SKU.

Display an Add to Cart Button

To display an add-to-cart button for a specific product, use:

[add_to_cart id="123"]

You can also use SKU:

[add_to_cart sku="woo-tshirt-logo"]

To display only the add-to-cart URL, use:

[add_to_cart_url id="123"]

This can be useful when creating custom buttons or CTA sections.

Advanced WooCommerce Product Shortcode Logic

You can use operators to control how WooCommerce selects products from categories, tags, and attributes.

Use cat_operator for Category Logic

To show products that belong to both the “summer” and “shirts” categories, use:

[products category="summer,shirts" cat_operator="AND"]

To show products from either “summer” or “winter,” use:

[products category="summer,winter" cat_operator="IN"]

To exclude a category, use:

[products category="summer" cat_operator="NOT IN"]

Use tag_operator for Tag Logic

To show products that match multiple tags, use:

[products tag="summer,new-arrival" tag_operator="AND"]

To show products that match either tag, use:

[products tag="summer,new-arrival" tag_operator="IN"]

Use terms_operator for Attribute Logic

To show products that match multiple attribute terms, use:

[products attribute="color" terms="blue,black" terms_operator="IN"]

To show products that match all selected terms, use:

[products attribute="color" terms="blue,black" terms_operator="AND"]

WooCommerce Product Category Shortcodes

WooCommerce has two important product category shortcodes:

[product_category]

and:

[product_categories]

WooCommerce documentation explains that displays products from a specified category, while [ product_categories ] displays product categories.

Display Products from One Category

Use:

[product_category category="hoodies"]

With layout control:

[product_category category="hoodies" limit="8" columns="4"]

Display All Product Categories

To display all WooCommerce product categories, use:

[product_categories]

To display categories in columns:

[product_categories columns="4"]

To hide empty categories:

[product_categories hide_empty="1"]

To show empty categories:

[product_categories hide_empty="0"]

WooCommerce documents hide_empty for product category shortcodes, with 1 hiding empty categories and 0 showing them.

Common WooCommerce Page Shortcodes

WooCommerce also includes shortcodes for important store pages.

PageShortcode
Cart[ woocommerce_cart ]
Checkout[ woocommerce_checkout ]
My Account[ woocommerce_my_account ]
Order Tracking[ woocommerce_order_tracking ]
Products[ products ]
Product Categories[ product_categories ]
Single Product Page[ product_page id=”123″ ]
Add to Cart Button[ add_to_cart id=”123″ ]

These are useful when creating or restoring core WooCommerce pages.

WooCommerce Shortcodes vs WooCommerce Blocks

WooCommerce shortcodes are still useful, but WooCommerce Blocks are now common in modern WordPress sites.

FeatureShortcodesWooCommerce Blocks
Editing styleText-basedVisual
Best forCustom placements and page buildersGutenberg layouts
Advanced filteringStrong parameter controlEasier visual controls
CompatibilityWorks in many editors and widgetsBest inside block editor
Ease of useRequires shortcode syntaxBeginner-friendly

Use WooCommerce Blocks when you want a visual editing experience.

Use WooCommerce shortcodes when you need exact control, advanced filtering, or compatibility with page builders like Elementor, Divi, or custom layouts.

WooCommerce’s shortcode documentation also references block alternatives for some shortcode use cases, including product collection blocks.

WooCommerce Shortcodes Not Working? Common Fixes

If your WooCommerce product shortcode is not working, check these common issues.

1. WooCommerce Is Not Active

WooCommerce shortcodes only work when the WooCommerce plugin is installed and active.

Go to:

Plugins → Installed Plugins

Then make sure WooCommerce is activated.

2. The Shortcode Is Misspelled

A small typo can break a shortcode.

Wrong:

[product limit="5"]

Correct:

[products limit="5"]

Wrong:

[products_categories]

Correct:

[product_categories]

3. You Used Curly Quotes Instead of Straight Quotes

Shortcodes should use straight quotes.

Wrong:

[products limit=”8”]

Correct:

[products limit="8"]

Curly quotes often appear when copying from word processors or formatted documents.

4. The Category, Tag, or SKU Does Not Exist

If you use a category, tag, or SKU that does not exist, WooCommerce may not display products.

Example:

[products category="winter-sale"]

Make sure winter-sale is the actual category slug.

5. Products Are Draft, Private, or Hidden

If products are not showing, check whether they are:

  • Published
  • In stock
  • Visible in the catalog
  • Assigned to the correct category or tag

6. Cache Is Showing an Old Version

If you recently changed a shortcode but do not see the update, clear your:

  • WordPress cache
  • Browser cache
  • CDN cache
  • Page builder cache

Then reload the page.

7. The Shortcode Is Inside a Code Block

If your shortcode appears as plain text, you may have placed it inside a Code block.

Use the Shortcode block instead.

CTX Gif Banner

What is the shortcode to display WooCommerce products?

The main shortcode to display WooCommerce products is:
[ products ]
You can customize it with parameters like limit, columns, category, tag, ids, skus, orderby, on_sale, best_selling, and top_rated.

How do I show WooCommerce products by category?

Use the category parameter with the [ products ] shortcode.
Example:


Make sure you use the category slug.

How do I show best-selling products in WooCommerce?

Use:
[ products best_selling=”true” ]
For a better layout:
[ products best_selling=”true” limit=”8″ columns=”4″ ]

How do I show sell products in WooCommerce?

Use:
[ products on_sale=”true” ]
Example:
[ products on_sale=”true” limit=”8″ columns=”4″ ]

How do I show featured products in WooCommerce?

Use:


Example:

How do I show the latest products in WooCommerce?

Use orderby=”date” and order=”DESC”.
Example:
[ products orderby=”date” order=”DESC” limit=”8″ columns=”4″]

How do I display a single WooCommerce product?

Use the shortcode.
Example:


Or use SKU:
[ product_page sku=”woo-tshirt-logo”]

How do I display WooCommerce product categories?

Use:
[ product_categories ]
To display products from a specific category, use:
[ product_category category=”hoodies” ]

Can I use WooCommerce shortcodes in widgets?

Yes. You can use WooCommerce shortcodes in widget areas that support shortcodes. Add a Shortcode block or Text widget, then paste your shortcode.
Example:
[ products on_sale=”true” limit=”4″ ]

Can I use WooCommerce shortcodes in Elementor?

Yes. Elementor and many other page builders support shortcodes. Add a Shortcode widget and paste your WooCommerce shortcode.
Example:
[ products best_selling=”true” limit=”8″ columns=”4″ ]

Final Thoughts

Shortcodes help you display products inside your site, but if you want to sell outside (on Google Shopping, Facebook, Pinterest or TikTok) you need a clean product feed. Plugins like CTX Feed can automatically sync your products to 130+ marketing channels, ensuring your shortcode-managed stock levels stay accurate everywhere.

2 thoughts
  1. Hello,

    I have a wholesale company, I’ve been open for 3yrs. So I have product lines that are 3yrs old. My home page currently displays the most recently ADDED products to the site, new product/SKU. Which is great, but I want the most recently UPDATED products too.
    For instance; a product line that I originally purchased over 2 yrs yrs ago, sold out of 6 month ago and found at my supplier again this week. I don’t want to have to creat a whole new product for it to show up on the home page with the other brand new products I also found this week. Or, if I make changes to price, color or size. Is there a short code to add those products to the “latest products” block on my home page.
    I have lots of other “staple” products that I buy over an over again. I don’t need them to show up unless I make a change like price.

    1. Hi, We couldn’t manage to find any shortcode that displays the newly updated items. So, you are requested to contact WooCommerce to get more info about this. Thank you!

Leave a Reply

8,279,063+ Downloads. 717+ plus 5-star ratings. Promote products on any platform you want.