Blog/
WooCommerce Shortcodes: The Ultimate Guide for 2025

WooCommerce Shortcodes: The Ultimate Guide for 2025

By Shon Joseph , Shon Joseph is a WordPress Developer at Webandcrafts with over 6 years of experience crafting responsive and high-performing websites. Shon specializes in WordPress, Shopify, and HTML, bringing a strong blend of design precision and technical expertise to every project.
  • Published in Blog on April 15, 2025
  • Last Updated on April 16, 2025
  • 8 mins read
Everything You Need To Know About WooCommerce Shortcodes

In 2024, WooCommerce led the global eCommerce platform market with a 39% share, followed by Squarespace Online Stores at 14.75% and Woo Themes at 13.96%. This strong market position reflects WooCommerce’s versatility and widespread trust, emphasizing the value of understanding its features to maximize store performance and customization.

Running an online store requires efficiency, flexibility, and customization. WooCommerce shortcodes simplify store management by enabling the quick implementation of essential features without the need for coding. This article provides a thorough analysis of the WooCommerce shortcodes list, their features, and how businesses may utilize them to enhance their eCommerce experience.

What Are Shortcodes in WooCommerce?

WooCommerce shortcodes are compact code segments written in square brackets (e.g., [woocommerce_cart]) through which users can embed dynamic content into pages, posts, or widgets without knowing any coding. These handy shortcodes give store owners the power to highlight essential WooCommerce features—like product listings, shopping carts, checkout forms, and customer account pages—anywhere on their website.

With WooCommerce shortcodes, customization becomes a breeze, letting store owners choose how they want their products and features to appear. For example, [products category="books"] displays products from a given category, and [add_to_cart id="123"] places a useful "Add to Cart" button for a given product.

Such ease of flexibility provides both coders and non-coders alike the ability to customise their eCommerce experiences easily. These shortcodes allow the simple design of special products, easy site navigation, or straightforward checkout. In other words, with WooCommerce shortcodes, the ease of adding features and usability to an online store has been simplified even further.

How Do WooCommerce Shortcodes Work?

WooCommerce shortcodes function as powerful tools that allow store owners to embed eCommerce features into specific sections of their websites without writing complex code. They work by pulling predefined WooCommerce functionalities and displaying them dynamically wherever they are placed—whether in posts, pages, or widgets.

When a shortcode is added to a page, WooCommerce processes it and replaces it with the relevant content or functionality. For example, [woocommerce_cart] instantly loads and shows the shopping cart page, letting customers check their orders before moving on to checkout. WooCommerce shortcodes make it easy for store owners to control how their products are displayed. With WooCommerce, businesses have less dependence on developers because its shortcodes provide flexibility for eCommerce changes, an improved customer experience, and a more appealing shop layout.

How to Add Shortcodes in Posts, Pages, and Widgets?

1. Adding Shortcodes in Posts and Pages 

The most common way to use WooCommerce shortcodes is to insert them directly into WordPress pages or posts. There are two ways to accomplish this:

  • Using the Block Editor in Gutenberg: In the WordPress editor, pick the desired page or post. Click the "+" (Add Block) button to select the Shortcode Block. 
  • Insert the WooCommerce shortcode, i.e., [woocommerce_cart], to view the cart page. This technique is ideal for inserting dynamic eCommerce components like product listings, checkout forms, and order tracking pages anywhere on the site.

2. Adding Shortcodes in Widgets

Shortcodes are used in showing categories or highlighted products on the sidebar and footer widgets of WooCommerce. To achieve this, follow the steps below:

  • Access the WordPress admin panel and click on Appearance > Widgets. 
  • Select a Text or Custom HTML widget and put it in the footer or sidebar. 
  • After pasting the shortcode into the widget's content box, make sure to save it.

This approach allows you to incorporate WooCommerce features, such as a mini cart or featured products, into your sidebars without altering the layout of the main page. 

Need help customizing WooCommerce with shortcodes?

Let's talk

Loading...

Essential WooCommerce Shortcodes

Page Shortcodes

WooCommerce makes it considerably easy to set up an online store. This is because WooCommerce's built-in shortcodes enable the automatic creation of necessary eCommerce pages without the need for human coding.  

1. Shop page [woocommerce_shop]
The [woocommerce_shop] is a WooCommerce shop page shortcode that serves as the backbone of your main product page, acting like a digital shelf that displays all your products.

2. Cart Page Shortcode – [woocommerce_cart]
Do you have a preference for a certain location for your shopping cart? That is exactly what the [woocommerce_cart] shortcode enables. This shortcode lets you add a fully functional cart to any page you want. Customers can easily use coupons, change item quantities, remove products, and finish their orders before making the final payment.

3. Checkout Page Shortcode – [woocommerce_checkout]
To create your own checkout page, just use the [woocommerce_checkout] shortcode. It renders the default checkout form, allowing customers to enter their billing details and complete payments. This allows customers to easily make their payments and enter their information.

4. My Account Page Shortcode – [woocommerce_my_account]
Customers can use the [woocommerce_my_account] shortcode to conveniently view and manage their account information in one location.

5. Order Tracking Shortcode – [woocommerce_order_tracking]
The order tracking function allows customers to monitor the status of their orders instantly using a unique order ID. This provides real-time updates to customers regarding their shipment.

Product Display Shortcodes

WooCommerce shortcodes let you display your products on any page you like. Rather than relying solely on the default shop page, you can implement dynamic and context-specific products across blogs, promotional pages, and landing pages. Strategically placing relevant products in the targeted locations optimizes user engagement and improves conversion rates.

1. [product id="123"] is the single product shortcode.  
This WooCommerce product shortcode allows you to position a certain product according to its unique ID. It works well when displaying best-selling or seasonal items across several pages.

2. [product_category category="shoes"] is the WooCommerce Category Shortcode.  
This shortcode can be used to display products under a particular category (such as Shoes or Accessories). It facilitates product categorization.  

3. [recent_products per_page="4" columns="2"] is the Shortcode for Recent Products.  
The newest items in your store are highlighted with this shortcode. Homepages or "New Arrivals" sections are the ideal places to use it.

4. Best-Selling Products Shortcode – [best_selling_products per_page="5"]  
It represents the best sellers through this shortcode from sales.

5. Featured Products Shortcode – [featured_products per_page="4" columns="2"]  
This shortcode shows WooCommerce items that have been designated as "featured." It's best used to promote popular or premium products.

6. On-Sale Products Shortcode – [sale_products per_page="6" columns="3"]  
This will draw attention to the available items, increasing sales. It can be ideal on the home page or a promotional page.

Add to Cart and Cart Display Shortcodes

WooCommerce cart shortcodes let customers buy products directly and easily manage their cart. The shortcodes simplify the add-to-cart process, which enhances the shopping experience.

1. Add to Cart Button Shortcode – [add_to_cart id="123"]  
This shortcode inserts an "Add to Cart" button for a particular product. Blog posts, email newsletters, and customized landing pages all benefit from its use.

2. Add to Cart URL Shortcode – [add_to_cart_url id="123"]  
This results in a straight link to add a product to the cart. It's ideal for email campaigns and social media advertising.

3. WooCommerce Cart Page Shortcode – [woocommerce_cart]  
The [woocommerce_cart] shortcode displays the full shopping cart on any WordPress page, allowing customers to view and manage their selected products before checkout.

Functionality Shortcodes

1. [woocommerce_my_account] – Customer Login & Account Dashboard  
This shortcode displays the login and registration form for users who are not logged in. Once logged in, it turns into a customer dashboard, giving access to downloads, order history, account details, and more.

2. [woocommerce_order_tracking] – Order Tracking Form  
It provides customers with a simple input form to check the status of their orders using their order ID and email address.

3. [woocommerce_my_account] – Account Management Area  
The [woocommerce_my_account] shortcode also serves as a hub where users can manage personal details and addresses and view past purchases all in one place. 

Cart and Checkout Shortcodes

1. [woocommerce_cart] is the shortcode for the Cart Page  
Displays the cart page where customers review items, apply coupons, and proceed to checkout.

2. [woocommerce_checkout] is the WooCommerce checkout shortcode.  
Adds payment, shipping, and billing information to the checkout page.  
Additional checkout fields are available for customization.

3. Order Confirmation Page Shortcode – [woocommerce_order_received]  
Displays a confirmation message after a successful order.

Product Category Shortcodes

Store owners can dynamically display particular product categories on various pages with WooCommerce product category shortcodes. These shortcodes can improve the shopping experience, help create category-based landing pages, and organize product listings effectively.

1. Display Products by Category  
[product_category category="accessories"] This shortcode will show all products within a specific category.

2. Display Several Selections  
[product_categories ids="15, 22, 34"] This shortcode will show multiple product categories at once.

3. Show the thumbnails for each category  
[product_categories number="4" columns="2"] This shortcode will help users discover what they need easily. A grid layout of category thumbnails will appear. This visual arrangement of product categories simplifies navigation for buyers.

Advanced WooCommerce Shortcodes

The codes mentioned above address key functionalities, but the following are advanced custom shortcodes tailored for specific scenarios.

Customizing Product Display

Store owners can use parameters in shortcodes to change how products are displayed. 
Custom Column Layouts:
With [products limit="12" columns="3"], 12 products in 3 columns would be shown, enhancing presentation and alignment.

Sorting Options:
These shortcodes can change the entire shopping experience. For instance, [items orderby="rating" order="DESC"] will show the products with the highest ratings first. Additionally, [products orderby="price" order="ASC"] can display the products in order of price, with the cheapest ones at the top. Shop pages, special offer sections, and custom product listings are all good places for these shortcodes to appear.

Filtering Products by Attributes:
The [products attribute="color" filter="blue"] shortcode is useful in showcasing products according to certain characteristics such as color, size, or brand. Customers' searches are made easier as only matching products are shown. Sections like "Shop by Color" and "Filter by Size" enhance the browsing experience and are excellently designed using this technique. In contrast to [products attribute="brand" filter="adidas"], which will only display Adidas products, [products attribute="size" filter="medium"] will display all medium-sized products.

Shortcodes for specific use cases

1. Show Featured Products
[featured_products per_page="4" columns="2"]
This will display 4 featured products in 2 columns. Such shortcodes are great for sections like "Top Picks".

2. Highlight Sale Items
[sale_products per_page="6" columns="3"]
This will showcase products that are currently on sale. This will be perfect for a "Deals of the Day" page.

3. Display Top-Rated Products
[top_rated_products per_page="5" columns="5"]
It will list products with the highest ratings. This is ideal for building trust with new customers.

4. Show Products from a Specific Category
[products category="clothing" limit="8" columns="4"]
This will be useful for creating category-specific landing pages like “Men’s Clothing” or “Summer Wear.”

5. Filter Products by Attributes
[products attribute="color" filter="red"]
This will help users quickly find products in specific colors, sizes, or materials.

6. Display Recently Added Products
[recent_products per_page="4" columns="2"]
This will highlight the latest products in your store — great for “New In” or “Just Arrived” sections.

7. Show Products by Tag
[products tag="new-arrival"]
This is perfect for building a “New Arrivals” or “Just In” section using product tags.

Conclusion

WooCommerce shortcodes are powerful tools that help store owners add eCommerce features like product listings, shopping carts, checkout pages, and account areas directly into any part of their website—without writing custom code. These shortcodes use pre-built WooCommerce functions to display dynamic content, making online stores more flexible, organized, and user-friendly. Whether it’s showcasing best-sellers, adding “Add to Cart” buttons in blog posts, or customizing checkout layouts, shortcodes improve the shopping experience and give full control over the site layout. For developers and non-developers alike, WooCommerce shortcodes offer a scalable and efficient way to manage and grow an online store.

For all WooCommerce development requirements, such as advanced integrations, performance tuning, and custom shop design, a reliable WooCommerce development Webandcrafts can be of help. As an expert in WooCommerce website development services, WAC enhances the overall store experience. To unleash the full potential of your WooCommerce store and bring it to the next level, contact WAC today.

Ready to take your WooCommerce store to the next level?

Reach out to us

Loading...

Discover Digital Transformation

Please feel free to share your thoughts and we can discuss it over a cup of tea.