Running a WooCommerce store? Then you’re sitting on a goldmine of functionality that most store owners completely overlook. I’m talking about shortcodes – those little bits of code that can transform your store’s presentation without touching a single line of PHP.
After helping dozens of online stores optimize their WooCommerce setup, I’ve learned that shortcodes are the secret weapon for creating a professional-looking store without hiring a developer. Let me show you exactly how to use them.
Understanding Shortcodes in WordPress
Think of shortcodes as shortcuts (hence the name) that tell WordPress to do something specific. They’ve been a core feature since WordPress 2.5 in 2008, and they look like this: [shortcode].
Instead of spending hours coding a product gallery or manually updating your featured items, you drop in a shortcode and boom – done. It’s like having a swiss army knife for your store’s layout.
What makes them brilliant is their simplicity. You get powerful functionality with just a few characters. Plus, when you need to make changes, you’re updating one shortcode instead of hunting through dozens of product pages.
Getting started with WooCommerce shortcodes
First things first – make sure WooCommerce is actually installed. Head to your WordPress dashboard, click Plugins > Add New, search for “WooCommerce,” and hit that install button. Once it’s activated, you’ll run through a quick setup wizard that handles your store basics like payment gateways and shipping zones.
Here’s something neat: WooCommerce automatically creates your Cart, Checkout, and My Account pages. These pages already use shortcodes behind the scenes, which is why they work right out of the box.
How Shortcodes Actually Work
The basic formula is straightforward. You’ve got your shortcode wrapped in brackets, and you can add attributes to customize what it does:
[shortcode attribute1="value1" attribute2="value2"]
Want to show four products in two columns? Just use: [products limit="4" columns="2"]
See how that works? You’re basically giving WordPress instructions in plain English (well, almost).
Where Can You Use Them?
Pretty much anywhere. I use them in:
- Blog posts to showcase relevant products
- Landing pages for special promotions
- Sidebars to display categories
- Footer widgets for featured items
The easiest way to add them in the block editor (Gutenberg) is to click the plus icon, search for “Shortcode,” and paste your code into that block. For classic editor fans, you can just paste the shortcode directly into your content.
One of my favorite tricks is adding product shortcodes to blog posts. Writing about hiking gear? Drop in a shortcode showing your best-selling hiking products right there in the article. It’s contextual selling at its finest.
Must-Know WooCommerce Product Display Shortcodes
Let’s get into the meat of this. The [products] shortcode is your workhorse – it’s incredibly versatile and handles most of what you’ll need.
The Main Attributes You’ll Use
- limit – How many products to show (default shows all)
- columns – Grid layout (default is 4 columns)
- orderby – Sort by date, price, popularity, title, etc.
- order – ASC for ascending, DESC for descending
- category – Filter by category slug
- paginate – Add page numbers (true/false)
Here’s a real-world example. Say you want your eight newest products displayed in a grid:
[products limit="8" columns="4" orderby="date" order="DESC"]
This creates a clean, four-column layout showing your latest additions. Your customers see fresh products first, which keeps your store feeling current.
Want pagination so visitors can browse through more products? Just add one more attribute:
[products limit="8" columns="4" orderby="date" order="DESC" paginate="true"]
Showing Products by Category
This is where things get really useful. Let’s say you have an accessories category and want to feature six items from it:
[products category="accessories" limit="6" columns="3"]
Quick tip: Make sure you use the category slug, not the full name. If your category is “Men’s Accessories,” the slug is probably “mens-accessories.”
Single Product Display
Need to highlight one specific product? Use the [product] shortcode with the product ID:
[product id="22"]
This is perfect for blog posts where you’re discussing a particular item. The product appears right there in your content with its image, price, and add-to-cart button.
For multiple specific products, use the plural version with IDs:
[products columns="3" ids="22,35,26"]
Full Product Page Embed
Here’s one that not many people know about: [product_page]. This doesn’t just show the product – it shows everything. The full description, tabs, reviews, related products, the works:
[product_page id="22"]
I use this when creating feature pages for hero products. It gives you the complete product experience without actually being on the product page.
Category Operators (This Gets Interesting)
The cat_operator attribute lets you filter products in sophisticated ways:
Show products in multiple specific categories: [products category="clothing,accessories" cat_operator="AND"]
Show products from any of these categories: [products category="clothing,accessories" cat_operator="IN"]
Exclude products from a category: [products category="clearance" cat_operator="NOT IN"]
That last one is great when you want to show your main product line without including clearance items.
Essential WooCommerce Cart and Account Shortcodes
These shortcodes are already working in your store, but knowing them helps if you ever need to recreate pages or add functionality elsewhere.
[woocommerce_cart] – Your complete shopping cart page [woocommerce_checkout] – The checkout experience [woocommerce_my_account] – Customer account dashboard [woocommerce_order_tracking] – Let customers track their orders
That order tracking shortcode is particularly useful. I’ve seen stores create a dedicated “Track Your Order” page in their menu, making it easier for customers to find their shipment status.
Category Display Options
Want to show off your product categories with nice thumbnails? The [product_categories] shortcode has you covered:
[product_categories number="12" columns="4" orderby="name" order="ASC"]
This creates a beautiful category grid. Pro tip: Make sure you upload thumbnail images for each category (Products > Categories > Edit category). Those images make a huge difference in how professional your store looks.
To show products from one specific category:
[product_category category="clothing" per_page="8" columns="4"]
Advanced Shortcode Techniques
Ready to level up? These specialized shortcodes help you create dynamic, engaging product displays.
Sale and Featured Products
Running a sale? Highlight those deals:
[products on_sale="true" limit="8" columns="4"]
Show off your featured products:
[featured_products limit="6" columns="3"]
To mark products as featured, go to your Products page and click the star icon next to any product. Simple as that.
Time-Sensitive Displays
The [recent_products] shortcode keeps your store feeling fresh:
[recent_products limit="5" columns="5"]
This automatically updates as you add new products. Set it once on your homepage, and it stays current without any manual updates.
Best Sellers and Top Rated
These shortcodes tap into your store’s performance data:
[best_selling_products limit="10" columns="4"] [top_rated_products limit="4" columns="2"]
Social proof is powerful. When visitors see your top-rated or best-selling products, it builds confidence and drives conversions.
Sale Products Display
Got items on discount? Show them prominently:
[sale_products limit="8" columns="3"]
Remember to set sale prices in your product data. That sale price field overrides the regular price, so double-check those numbers before publishing.
Making It All Work Together
The real magic happens when you combine these shortcodes strategically throughout your store. Here’s how I typically structure a homepage:
- Recent products at the top (always fresh content)
- Featured products in the middle (your hero items)
- Best sellers near the bottom (social proof)
- Product categories in the footer (easy navigation)
For category pages, I’ll often add related categories at the bottom to encourage browsing. Blog posts get relevant product shortcodes embedded naturally in the content.
Performance Matters
One thing to watch: shortcodes are convenient, but they do create database queries. If you’re running a massive catalog, too many shortcodes on one page can slow things down.
Keep your product limits reasonable, and consider caching if you’re dealing with high traffic. Most quality hosting providers handle this automatically, but it’s worth knowing about.
Final Thoughts
Shortcodes might seem simple, but they’re one of the most practical tools in your WooCommerce toolkit. They give you the flexibility to display products however you want, wherever you want, without touching code.
Start with the basics – try adding a products shortcode to your homepage. See how it looks, adjust the attributes, experiment with different layouts. Once you’re comfortable, you can create really sophisticated product displays that would otherwise require custom development.
The best part? Everything updates automatically. Change a product price, mark something as featured, add a new item – your shortcodes reflect those changes instantly across your entire site.
That’s the power of working smart instead of hard. Your store gets professional functionality, you save time, and your customers get a better shopping experience. Everybody wins.