On this page
If you’re building an online store with WordPress, chances are you’ve come across WooCommerce—the platform powering millions of successful shops worldwide. It’s flexible, feature-packed, and works brilliantly for selling everything from physical products to digital downloads. But here’s something many store owners overlook: WooCommerce comes with a hidden superpower—shortcodes. These small, bracketed snippets let you instantly add store features anywhere on your site without writing a single line of code.
The beauty of WooCommerce shortcodes is in their versatility. You can use them to showcase best-selling items, create a tailored checkout page, embed your shopping cart on any landing page, or even spotlight specific product categories. They work in posts, pages, widgets—anywhere WordPress supports content. Whether you’re new to eCommerce and want quick customisation, a developer building unique layouts, or a business owner running time-sensitive promotions, shortcodes make it easy. And while adding features is important, keeping your store safe matters too—check out this guide on protecting your WooCommerce store from suspicious users and IP addresses to ensure your site runs smoothly. In this guide, we’ll cover how to use WooCommerce shortcodes, share practical WooCommerce shortcode examples, and reveal tips to get the most out of them.
What Are WooCommerce Shortcodes?
In WordPress, a shortcode is a small text snippet wrapped in square brackets that acts as an instruction for the system to display a specific feature or type of content. Instead of writing complicated code, you simply place the shortcode into a page, post, or widget, and WordPress replaces it with the intended output automatically.
WooCommerce takes this concept further by providing its own set of shortcodes designed specifically for online shops. These allow you to add dynamic store elements—such as product listings, shopping carts, checkout forms, or account pages—anywhere on your site.
Key differences between WordPress and WooCommerce shortcodes
WordPress shortcodes – General-purpose, can be used for things like image galleries, contact forms, or embedded videos.
WooCommerce shortcodes – Specialised for eCommerce, working directly with product data, cart systems, and checkout processes.
Advantages of using WooCommerce shortcodes
Time-saving – No need to build layouts from scratch or write PHP.
Beginner-friendly – Works with simple bracket syntax instead of coding.
Flexible placement – Can be added to posts, pages, widgets, and even custom templates.
Dynamic content – Automatically pulls live product data from your store.
For example, if you wanted to display four products in a grid on any page, you could simply use
[products limit="4" columns="4"]
This shortcode tells WooCommerce to show four products in four columns, perfect for a homepage section or promotional landing page. With just a few words in brackets, you can achieve results that would normally require a developer’s time and effort.
How to Use WooCommerce Shortcodes (Step-by-Step)
WooCommerce shortcodes are incredibly flexible and can be placed almost anywhere on your WordPress site. Whether you’re working in the Classic Editor, Gutenberg, or a page builder like Elementor or WPBakery, shortcodes make it easy to insert store features without any coding.
1. Where You Can Place Shortcodes
You can use WooCommerce shortcodes in a variety of locations, including:
Pages – Great for creating custom shop, checkout, or promotional landing pages.
Posts – Ideal for blog articles that promote specific products or sales.
Widgets – Add products or categories to sidebars and footers.
Gutenberg blocks – Insert shortcodes directly inside content blocks.
Page builders – Most modern builders have shortcode elements you can drag and drop.
This flexibility means you can display your store content exactly where you want it, rather than being limited to WooCommerce’s default layouts.
2. Adding Shortcodes in the Classic Editor vs. Gutenberg
Classic Editor:
Open the page or post where you want to display the WooCommerce element.
Paste the shortcode directly into the content area.
Update or publish the page to see the result.
Gutenberg Editor:
Click the + icon to add a new block.
Search for the Shortcode block and select it.
Paste your shortcode inside the block.
Preview or publish to see it in action.
3. Using Shortcodes with Elementor or WPBakery
Elementor:

Drag the Shortcode widget onto your page.
Paste your WooCommerce shortcode into the widget settings.
Style the surrounding layout with Elementor’s design tools.
WPBakery Page Builder:
Use the Raw HTML or Text Block element.
Paste your shortcode inside, save, and publish.
These page builders make it easy to combine WooCommerce functionality with custom designs, giving you full creative control.
4. Tips for Customising Shortcode Attributes
Most WooCommerce shortcodes have attributes—extra settings inside the shortcode that change how it works. For example:
[products limit="8" columns="4" category="t-shirts" orderby="date" order="DESC"]
Here’s what’s happening:
limit – Number of products to display.
columns – How many columns to show.
category – Only display products from a specific category.
orderby / order – Control the sorting (e.g., newest first).
You can combine multiple attributes to create highly targeted product displays.
5. Common Mistakes to Avoid
Incorrect spelling – Shortcodes must be typed exactly as shown, without spaces inside the brackets.
Using the wrong category slug – Ensure the category name matches its slug (lowercase, no spaces).
Forgetting to close the shortcode – While most WooCommerce shortcodes don’t require a closing tag, some do.
Using too many at once – Overloading a page with multiple product shortcodes can slow down performance.
Not checking mobile layouts – Shortcodes may look fine on desktop, but need adjustment for smaller screens.
Overview of Default WooCommerce Shortcodes:
| Shortcode | Description |
|---|
| [woocommerce_cart] | Displays the cart page. |
| [woocommerce_checkout] | Displays the checkout page. |
| [woocommerce_my_account] | Displays the user account page. |
| [woocommerce_order_tracking] | Displays the order tracking form; supports attributes. |
| [product_page] | Displays a full single product page by ID or SKU. |
| [products] | Displays multiple products based on parameters like category, tag, limit, and order. |
| [product_category] | Shows products from a specified category with customisable layout options. |
| [product_categories] | Displays a list or grid of product categories with optional filtering. |
| [add_to_cart] | Displays an “Add to Cart” button for a specific product with optional styling. |
| [add_to_cart_url] | Retrieves the URL for a product’s add-to-cart button; useful for custom links. |
| [shop_messages] | Shows WooCommerce system messages (e.g., errors, notices) on non-shop pages. |
| [featured_products] | Displays products marked as featured in a grid layout. |
| [sale_products] | Shows products currently on sale with customisable display options. |
| [best_selling_products] | Highlights your store’s best-selling products. |
| [top_rated_products] | Displays products with the highest customer ratings. |
| [recent_products] | Lists the most recently added products. |
| [related_products] | Shows products related to the current product being viewed. |
| [product_attribute] | Displays products filtered by a specific product attribute like color or size. |
List of Common WooCommerce Shortcodes
WooCommerce offers a range of shortcodes that help you add powerful eCommerce features to your WordPress site quickly and easily. These shortcodes work only if you have WooCommerce installed and activated on your website.
WooCommerce Cart Shortcodes:
1. Cart
[woocommerce_cart]
This shortcode displays the contents of the shopping cart, including product thumbnails, names, prices, quantities, and the subtotal. It supports several parameters that let you customise the output, such as columns, show_shipping, show_coupon, show_totals, and button_text.
Example: [woocommerce_cart columns="2" show_shipping="true" show_coupon="true" button_text="Proceed to Checkout"]
This will display the shopping cart with 2 columns, shipping options, a coupon code field, and a checkout button labeled “Proceed to Checkout”.
2. Cart Total
[woocommerce_cart_total]
This shortcode shows the total price of the shopping cart. You can customise it using parameters like class and before.
Example: [[woocommerce_cart_total class=”my-cart-total” before=”Total: “]]
This will display the cart total with a custom CSS class and the prefix “Total: ” before the amount.
3. Cart Coupon
[woocommerce_cart_coupon]
This shortcode adds a coupon code input field on the shopping cart page. It accepts parameters such as class and placeholder.
Example: [woocommerce_cart_coupon class=”my-cart-coupon” placeholder=”Enter coupon code”]
This will display the coupon field with a custom class and placeholder text “Enter coupon code”.
4. Cart Shipping
[woocommerce_cart_shipping]
This shortcode displays the shipping options available on the cart page. You can modify it using parameters like class and before.
Example: [[woocommerce_cart_shipping class=”my-cart-shipping” before=”Shipping: “]]
This will show the shipping methods with a custom class and the label “Shipping: ” before the options.
5. Cart Contents
[woocommerce_cart_contents]
This shortcode outputs the cart contents in a table format. It supports parameters such as class, before, and after to customise the HTML structure.
Example: [woocommerce_cart_contents class=”my-cart-contents” before=”<table>” after=”</table>”]
This will display the cart items inside a table with a custom class and custom HTML tags wrapping the content.
WooCommerce Checkout Shortcodes
1 Checkout
This shortcode displays the full checkout form with all necessary fields for customers to complete their purchase. It supports parameters like order_review, terms, privacy_policy, and login_form to customise the checkout experience.
Example: [woocommerce_checkout order_review="false" terms="true" privacy_policy="true" login_form="false"]
This will show the checkout form without the order review section but with the terms and privacy policy checkboxes enabled.
2. Checkout & Cart
[woocommerce_checkout_cart]
This shortcode displays the shopping cart contents on the checkout page. It includes parameters such as show_shipping, show_coupon, and show_cart to control which elements are visible.
Example: [[woocommerce_checkout_cart show_shipping=”true” show_coupon=”false” show_cart=”false”]]
This setup displays the cart contents with shipping options but hides the coupon code field and cart totals.
3. Checkout Order Review
[woocommerce_checkout_order_review]
This shortcode renders the order review section on the checkout page, including the product list, shipping details, and total cost. You can customise it with parameters like show_shipping, show_coupon, and show_cart.
Example: [[woocommerce_checkout_order_review show_shipping=”false” show_coupon=”false” show_cart=”false”]]
This example shows only the order review section without shipping, coupon, or cart details.
4. Checkout Fields
[woocommerce_checkout_fields]
Use this shortcode to display specific checkout fields such as billing and shipping addresses, payment methods, and order notes. Parameters include order, fields, and required to specify which fields appear and which are mandatory.
Example: [[woocommerce_checkout_fields order=”billing,shipping” fields=”first_name,last_name,email,phone” required=”first_name,last_name,email”]]
This will display billing and shipping fields for first name, last name, email, and phone, requiring the first name, last name, and email fields to be filled out.
WooCommerce Product Shortcodes: Detailed Guide with Examples
1. Products
[products]
This shortcode displays a grid of multiple products on your page, complete with pagination and sorting features. You can filter and customise the products shown by using various parameters such as:
category — show products from a specific category
tag — filter products by product tags
limit — number of products to display
columns — number of columns in the grid
orderby — sorting criteria (e.g., date, price, popularity)
order — ascending (asc) or descending (desc) order
Example:
[products limit="4" columns="2" orderby="price" order="asc"]
This shortcode will display 4 products arranged in 2 columns, sorted by price in ascending order (lowest price first).
2. Product Category
[product_category]
Use this shortcode to display products from a single product category. It shares many parameters with the [products] shortcode, letting you control the number of items, layout, and sorting.
category — slug of the product category
limit — how many products to show
columns — number of columns
orderby and order — sorting options
Example:
[product_category category="clothing" limit="6" columns="3"]
This will show 6 products from the “clothing” category arranged in 3 columns.
3. Products by SKU
[[products_by_sku]]
This shortcode lets you display specific products by listing their SKUs (Stock Keeping Units). It’s useful when you want to showcase particular items without relying on categories or tags.
Example:
[[products_by_sku skus="ABC123, DEF456, GHI789" limit="3"]]
This will display 3 products identified by the SKUs ABC123, DEF456, and GHI789.
4. Recent Products
[recent_products]
Displays your newest products in a grid. Parameters allow you to specify the number of items and their layout.
Example:
[recent_products limit="8" columns="4"]
This shortcode will show 8 recently added products arranged in 4 columns.
5. Best Selling Products
[best_selling_products]
Showcases your top-selling products, helping highlight popular choices in your store.
Example:
[best_selling_products limit="10" columns="5"]
Displays the top 10 best-selling products in 5 columns.
6. Single Product
[product]
Use this shortcode to display a single product on any page or post. You can identify the product by its ID or SKU.
id — product ID
sku — product SKU
Example:
[product id="123"]
This will show the product with the ID 123, including all its details like images, description, and price.
7. Product Attribute
[product_attribute]
Display products filtered by a specific attribute such as color, size, or material. This shortcode is handy for showcasing items sharing a particular characteristic.
attribute — the attribute name (e.g., color)
terms — attribute values to filter by (e.g., red)
operator — how to match terms (AND, OR)
limit — number of products
columns — number of columns
Example:
[product_attribute attribute="color" terms="red" operator="OR" limit="6" columns="3"]
This shows up to 6 products with the “red” color attribute in a 3-column grid.
8. Featured Products
[featured_products]
Displays products marked as featured in your WooCommerce store. Perfect for highlighting special items on your homepage or landing pages.
Example:
[featured_products limit="8" columns="4"]
This will display 8 featured products in 4 columns.
9. Product Tags
[[product_tags]]
This shortcode lists product tags with links to their archives, helping visitors browse products by tags.
exclude — IDs of tags to exclude
orderby — sort criteria (e.g., name, count)
order — ascending or descending
Example:
[[product_tags exclude="15,20" orderby="count" order="DESC"]]
This lists product tags ordered by the number of products, excluding tags with IDs 15 and 20.
10. Product Page
[product_page]
Embed a full product page for a specific product by ID anywhere on your site.
Example:
[product_page id="123"]
This displays the entire product page for product 123, including images, description, reviews, and purchase options.
11. Product Reviews
[[product_reviews]]
Shows a list of reviews for a specific product. You can limit how many reviews to display.
Example:
[[product_reviews id="123" limit="5"]]
This will display up to 5 reviews for product 123.
12. Product Description
[[woocommerce_product_description]]
Displays the description section of a product on your page.
13. Product Price
[[woocommerce_product_price]]
Shows the current price of a product.
WooCommerce Order Tracking and User Account Shortcodes
Order Tracking Form
[woocommerce_order_tracking]
This shortcode adds a simple, user-friendly form that allows customers to track the status of their orders directly on your website. By entering their order ID and billing email address, customers can quickly view updates such as shipping progress, delivery status, and order completion without needing to log in.
This feature improves customer experience by providing transparent order tracking and reducing support requests.
Example:
[woocommerce_order_tracking]
Simply place this shortcode on any page where you want customers to have access to order tracking. It will display a clean form with two input fields and a submit button.
User Account Dashboard
[woocommerce_my_account]
This shortcode creates the customer account dashboard, a secure area where registered users can manage their personal information and order history. It includes sections for:
Viewing recent and past orders
Downloading digital products
Editing billing and shipping addresses
Changing account passwords and details
Managing subscriptions (if applicable)
When users are not logged in, this shortcode automatically displays login and registration forms, making it easy for new and returning customers to access their accounts.
Example:
[woocommerce_my_account]
Add this shortcode to a page titled “My Account” or similar to provide customers with a seamless way to manage their profiles and orders.
How to Troubleshoot WooCommerce Shortcode Issues
If you’re encountering issues with WooCommerce shortcodes not functioning as expected, follow these steps to identify and resolve the problem:
Confirm WooCommerce is Installed and Activated
Make sure the WooCommerce plugin is installed and active on your WordPress site. Without WooCommerce, none of its shortcodes will work.
Verify Shortcode Syntax
Check that you’re using the correct shortcode syntax, including square brackets [ ] and proper parameters. Refer to the official WooCommerce documentation for guidance.
Check for Plugin Conflicts
Other plugins may interfere with WooCommerce shortcodes. Temporarily deactivate other plugins and test your shortcodes. If the problem resolves, reactivate plugins one by one to find the conflict. If you’re managing user roles or want to block unwanted users to reduce conflicts, consider tools like Blacklister for WooCommerce.
Switch to a Default Theme
Your active theme might be causing the issue. Switch to a default WordPress theme (like Twenty Twenty-One) temporarily to see if the shortcode works.
Clear Caches
Caching plugins or server caches may prevent updates from appearing. Clear all caches and reload your site.
Contact WooCommerce Support
If none of the above solves the issue, reach out to WooCommerce support for detailed help.
Frequently Asked Questions
How do I add WooCommerce shortcodes to my pages?
To add WooCommerce shortcodes, simply edit your WordPress page or post. If you’re using the Gutenberg editor, add a “Shortcode” block and paste the shortcode like [products]. For the Classic Editor, paste the shortcode directly where you want it to appear. When saved, the shortcode will show the corresponding WooCommerce content dynamically.
Can I use multiple WooCommerce shortcodes on the same page?
Yes, you can add multiple WooCommerce shortcodes on a single page to show different elements like product grids, the shopping cart, and the checkout form. Just ensure each shortcode is placed properly and they don’t visually conflict.
Why aren’t my WooCommerce shortcodes working?
Common reasons include the WooCommerce plugin not being activated, incorrect shortcode syntax, conflicts with other plugins or themes, or caching issues. Check these areas to fix the problem.
Can I customise which products are shown using shortcodes?
Yes, many product shortcodes support parameters like limit, columns, orderby, and category to control which products display and how they’re arranged.
How do I display products from a specific category?
Use the shortcode [product_category category="category-slug" limit="6" columns="3"], replacing “category-slug” with your actual product category name.
Can I add an Add to Cart button for a single product anywhere?
Yes! Use [add_to_cart id="123"], replacing 123 with the product ID, to add an Add to Cart button anywhere on your site.
Are WooCommerce shortcodes mobile-friendly?
Yes, WooCommerce shortcodes are designed to be responsive and adapt well to mobile devices.
Can I restrict shortcode content based on user roles?
WooCommerce doesn’t offer this natively, but you can use plugins or custom code to restrict shortcode visibility by user role.
Multi-currency shortcodes: selling the same page in more than one currency
Every shortcode above outputs prices in a single currency, the store’s base currency. WooCommerce has no shortcode that converts a price, or that switches a visitor to the currency they actually spend in, because currency handling is not part of WooCommerce core.
The Aelia Currency Switcher adds four shortcodes that cover this. They work anywhere the WooCommerce shortcodes above work: pages, posts, text widgets, and theme templates via do_shortcode().
Currency selector widget
Places a currency selector in the body of a page rather than leaving it in a sidebar. Example: [aelia_currency_selector_widget title="Choose your currency" widget_type="dropdown_flags"]
The widget_type attribute accepts dropdown (the default), dropdown_flags or buttons. The currency_display_mode attribute accepts show_currency_code to show EUR, GBP, USD, or show_currency_name to show Euro, Pound Sterling, United States Dollar.
Billing country selector
For stores that set the currency from the billing country instead of letting the customer choose it. Example: [aelia_cs_country_selector_widget title="Delivery country" widget_type="dropdown"]
Product price in a specific currency
Prints one product’s price, either in the currency the visitor is browsing in or in a currency you name. Useful on landing pages and comparison tables, where a hardcoded price goes stale the moment you change it in the catalogue. Example: [aelia_cs_product_price product_id="123" price_type="price" formatted="1" currency="USD"]
The price_type attribute accepts price, regular_price, sale_price, and sign_up_fee for subscription products. Set formatted to 1 for a currency symbol and thousand separator, or 0 for a raw number you can calculate with. Omit currency and the price follows whichever currency the visitor has selected.
Convert any amount
Converts a figure that is not attached to a product. This is the one for free-shipping thresholds, pricing tables and “from” copy that should follow the visitor’s currency instead of being rewritten by hand for every market. Example: [aelia_cs_currency_amount amount="49.00" from_currency="GBP" to_currency="EUR" formatted="1"]
The full attribute reference for all four is in the Aelia Currency Switcher shortcodes article.
If you are placing shortcodes to build a store that sells across borders, currency is the layer WooCommerce leaves to you. The Currency Switcher converts prices, takes the payment in the currency the customer selected rather than converting it on their bank statement, and records the exchange rate against each order so refunds and accounts still reconcile months later. A premium licence is £89.00 ex. VAT for a single site, annual, with updates and support included, a 14-day free trial and a 30-day money-back guarantee. See the Aelia Currency Switcher.
Related reading: how to change currency in WooCommerce based on customer location.