You may find many posts about WooCommerce shortcodes online. In this article, you’ll find the full WooCommerce shortcode list with screenshots. Quickly! I will also show you how to add custom shortcodes in WordPress and WooCommerce for products, shop, login, cart, and checkout to name a few.
Table of contents
- WooCommerce shortcodes - Basics
- WooCommerce shortcodes list (with links)
- Common issues & compatible WooCommerce plugins
- Custom shortcodes in WordPress and WooCommerce
- WooCommerce shortcodes summary (and free plugins)
WooCommerce shortcodes - Basics
What are the WooCommerce shortcodes?
In short, they are shortcuts that let you add something without touching PHP code 😨!
Some WooCommerce shortcodes in fact work right after the plugin is installed. These shortcodes generate cart, checkout, and my account on the default WooCommerce pages.
Also, many WooCommerce shortcodes have additional shortcode parameters (attributes) to customize the output. Thus, advanced shortcode customization will not require hiring a developer.
Where to use WooCommerce shortcodes?
You just need to add the specific shortcode name inside the Gutenberg Shortcode block.
With Classic Editor 💪, it’s even simpler 😉.
How to add WooCommerce shortcodes?
You don't need special plugins to add a shortcode. The plain post/ page editor will suffice.
- Edit a page or a post
- Add a WordPress or WooCommerce shortode inside []
- Update the changes and check the page in the browser
- If you can't see any effects, you may start troubleshooting
Of course, such a plugin may help in shortcode management or see the available shortcodes in WooCommerce.
Why use WooCommerce shortcodes?
They will save you a lot of time! And you can customize posts and pages. For example, you may create landing pages with a specific layout, products, advanced category or product view, login form, or even checkout 🚀.
I have used the Gutenberg editor to add 2 shortcodes (just names) but also a classical one to show you the [] for the WooCommerce shortcodes. And these 3 little shortcodes did the job 🙂.
It was super easy 😀.
What shortcodes can I find in WooCommerce?
WooCommerce comes with built-in shortcodes that you can use right after installing the plugin. Most WooCommerce shortcodes help generate products, product information, or specific functionality of the store quickly.
After the installation (if you let the WooCommerce creator do its job), you will get 3 pages (Cart, Checkout, and My Account) with appropriate shortcodes for each functionality.
Of course, you can change default pages for Cart, Checkout, or My Account but remember to add corresponding WooCommerce shortcodes so they work properly. It’s quite simple 😀
Ok, so let’s jump right into these WooCommerce shortcodes to learn how to use them 🚀.
WooCommerce shortcodes list
- WooCommerce Cart & Checkout shortcodes
- WooCommerce General shortcodes
- WooCommerce Product shortcodes
- WooCommerce Products shortcodes
- WooCommerce Product Category shortcodes
- Bonus 1: WooCommerce Gutenberg blocks - alternative to shortcodes? 🚀
- Bonus 2: WordPress shortcodes 🙂
There are many types of WooCommerce shortcodes - for products, shop, cart, checkout, login, and My Account pages. The below shortcode examples give some insight into their possible usage.
WooCommerce Cart & Checkout shortcodes
Apart from the default WooCommerce cart & checkout pages (set in WooCommerce → Settings → Advanced → Page setup), you may use the appropriate shortcodes on other pages and posts.
woocommerce_cart
The shortcode simply adds a WooCommerce cart with cart content, a place for a discount coupon, and the Update cart button. No additional arguments.
add_to_cart
WooCommerce lets you use the add_to_cart shortcode to place the Add to Cart button on a single post or page.
The shortcode may get arguments. In my example, I used:
add_to_cart id="46" show_price="true" style="border:10px solid blue; padding: 20px;" sku="alternative-to-id" class="css-class" quantity="1"
Of course, remember about the opening and closing [] 🙂.
add_to_cart_url
This shortcode takes only two arguments (id or sku) and gives you the URL on the Add to Cart button of a specific product (id or sku).
woocommerce_checkout
This is one of the most important WooCommere shortcodes 💪. It generates the same WooCommerce checkout form, as you know from the WooCommerce Checkout page.
To create custom checkout forms in WooCommerce, you may use a free checkout customizer.
General shortcodes
These are additional WooCommerce shortcodes you may want to use to customize a store.
shop_messages
You may use the first one to show the store messages on non-WooCommerce pages (according to WooCommerce). For example, when you create custom product lists or use the add_to_cart shortcode so that your customer can see the notifications right away 🎉.
woocommerce_my_account
The second general shortcode will generate the WooCommerce My Account page. It’s useful to show customers previous orders and let them manage their accounts.
woocommerce_order_tracking
Finally, this shortcode lets your customers track their orders by inserting the order number and email address. WooCommerce order tracking can be a useful feature for users that may reduce support workload.
WooCommerce Product shortcodes
WooCommerce also comes with many shortcodes for displaying products. Thus, creating a post or page with specific products and a customized layout is a breeze 🌬️.
First, I will show you how to use single-product shortcodes, then I will move to ones for displaying more WooCommerce products. Let’s dive in 🙂!
The product ID is visible on the product edit screen (inside the URL, for example, wp-admin/post.php?post=46&action=edit). Note: I will use this ID in my shortcodes below 😀. You see the ID when you hover over the product on the WooCommerce product list too.
You may find the SKU next to the product ID and before the product quantity. In my example, 12341234. If you don’t see the column for the product SKU, enable it in the Screen Options.
You may also find the product SKU in the Edit Product screen → Product data → Inventory → SKU 🙂.
Ok, let’s move on to the WooCommerce shortcodes for displaying products!
product
This shortcode looks very simple, yet it’s quite powerful. It shows one product with basic information (name, image, review stars, price, Add to Cart button) so you may point to a specific product fast ⭐.
product_page
To get the full product page inside a post/page you can use this shortcode. It will generate the complete product page with a description, additional information, price, related products, etc.
It’s a nice option for blog posts or LPs where you first want to “prepare the ground” before pointing to a specific product to buy 🙂.
product_attribute
This shortcode came in older WooCommerce (before 3.2) but it still works (as of the end of 2023 🙂). It will get all products with a given attribute (this is an argument), for example, attribute="size".
The new products shortcode with attribute="size" took the necessity of using the separate product_attribute shortcode so you may use it instead 👍.
WooCommerce Products shortcodes
Let’s see the most athletic WooCommerce shortcodes 💪, that will help you create beautiful page/post layouts 🎨 and shoot for higher conversion rates 🙂.
products
This shortcode comes with dozens of options and arguments 😮!
What the products shortcode does is display products on a page, post, in sidebar, or text widget where you placed the shortcode. Easy, right? The hard part is to use the shortcode attributes wisely 😀. Without them, the shortcode will show all products in your store!
The products shortcode’s attributes
Let’s see these attributes first.
- limit - it’s self-explanatory 🙂 By default, it’s limit="-1" so all products that meet other criteria will be displayed.
- columns - decide in how many columns you want to show your products. The default value is 4.
- ids - display products with specific ids (comma-separated).
- skus - product SKUs separated by a comma.
- visibility - decide whether to show visible (default value - products visible both on shop and search results), catalog (visible on shop only), search (visible on search results only), hidden (from shop or search results but accessible via URL), or featured (marked as Featured) products. The results will get products with specific visibility - you can set it for each product.
- on_sale - show on sale products (use: on_sale="true"). This attribute should not be used together with best_selling or top_rated arguments. WooCommerce does not recommend using this argument together with ids, skus, attribute, terms, terms_operator, tag, tag_operator, category, cat_operator, and visibility.
- best_selling - show best selling products (use: best_selling="true"). This argument should not be used together with on_sale or top_rated. WooCommerce does not recommend using this argument together with ids, skus, attribute, terms, terms_operator, tag, tag_operator, category, cat_operator, and visibility.
- top_rated - show top rated products (use: top_rated="true"). This argument should not be used together with on_sale or best_selling.
- paginate - paginate="true" will turn on pagination for products based on the limit. It’s disabled by default (paginate="false").
- orderby - choose the way to sort your products. You may choose one or multiple values (separated by space) from the list: title (by default), date (when the product was published), id (by the post ID of the product), menu_order (the lower the Menu Order number the higher the product will appear), popularity (by the number of purchases), rand (randomly show products, but may not work well with cache), and rating (by average product rating). For example, orderby="title rating" will sort products by title and their ratings.
- order - set the order type (ASCending or DESCending) for a given orderby values, for example, order="ASC" (default value).
- class - give the product container (div) a specific CSS class for further styling and customization.
- attribute - show products with a specific attribute slug, for example, attribute="size".
- terms - give a list of attribute (above) terms (comma-separated or one term) to modify the products you want to show your customers, for example, terms="Large, Medium" will show products with size attribute (large or medium).
- terms_operator - decide about the way terms impact the product search. By default, the terms_operator takes the IN value so the product should have at least one of the given attribute’s terms. You may also choose AND (the product should have all values of the attribute), or NOT IN (self-explanatory) values.
- tag - show products from inserted tags (comma-separated).
- tag_operator - it works the same for the product tag as terms_operator for the product attribute. The argument gets the IN (default), AND, and NOT IN values.
- category - show products from a given category/categories separated by a comma.
- cat_operator - it works the same for the product category as terms_operator for the product attribute or tag_operator for the product tag 🙂. The argument gets the same 3 values: IN (default), AND, and NOT IN.
The WooCommerce products shortcode - how-to-use ideas
Let’s see now some examples of using the products shortcode in your posts, pages, sidebars, or text widgets.
First, you may type the shortcode (with [] 🙂): products category="food" cat_operator="NOT IN" orderby="rating" order="DESC" limit="4" columns="2":
Next, let’s show 8 best selling products from the food category in 4 columns with the products shortcode: products category="food" best_selling="true" limit="8" columns="4":
Finally, let’s display all products with pagination after 4 products and 2 columns based on the title and popularity: products limit="4" paginate="true" columns="2" orderby="title popularity":
I encourage you to test the products shortcode in your WooCommerce to create beautiful layouts and engaging content ⭐🙂🎉!
sale_products
The sale_products shortcode will show WooCommerce products on sale 🏷️ . For example, you can use it with the limit and columns arguments to get the interesting result:
best_selling_products
Similarly, this shortcode was introduced before WooCommerce 3.2, and you may use the products shortcode now. If you decide to use the older best_selling_products you will receive products with most purchases. So it works like the best_selling argument for the products shortcode 🪙.
recent_products
The older WooCommerce also gave us the recent_products shortcode that works similarly to the orderby="date" argument for the new products shortcode. You may also use columns or limit the results, it works quite fast 💨.
top_rated_products
You can show WooCommerce products with the best ratings (similar to orderby="rating" in the products shortcode) using, for example, top_rated_products columns="2" limit="4" ⭐.
related_products
This shortcode generates the related products (use the limit, orderby="title", and columns args to customize it) on a single product page. Currently, WooCommerce shows the Related Products in a separate section, but, of course, you may use the old one (or the products shortcode) 🙂.
featured_products
Featured products are selected products you want your customers to focus on.
It’s also possible to show the featured products on a single post or page using the older featured_products shortcode (or the new products visibility="featured" shortcode) ⭐.
WooCommerce Product Category shortcodes
Finally, we have two powerful 💪 WooCommerce shortcodes to show products by category and product categories!
In my opinion, they are very useful for creating general-level information about products in your store, for example, pointing to WooCommerce product categories.
product_categories
This shortcode generates the category list (with images) based on arguments. Hint: you can set the category image and description in Products → Categories → Edit category ⚙️. I set one column in my example.
The shortcode can also get additional attributes that can help get customized results 👍:
- ids - choose the specific categories using the category id (tag_ID visible when you hover over a category in Products → Categories.
- limit - the number of categories.
- columns - to display (4 by default).
- hide_empty - 1 by default, set to 0 to show all categories including empty ones.
- parent - it’s an interesting argument. You may set it to 0 to show only top-level categories. Also, you can set it to a specific category ID to show its subcategories (child categories).
- orderby - set the sorting method: name (by default), id, slug, menu_order, or include (if you specified the ids for categories).
- order - set to ASC (default) or DESC to choose the category ordering.
product_category
Last, but not least 🙂 is product_category - one of the most interesting WooCommerce shortcodes. It works as if you use the category="" argument in the products shortcode. The advantage of this one is that you focus on a specific product category.
The shortcode gets the following attributes:
- category - choose the specific category; you may use the category name, ID, or its slug.
- limit - the number of products.
- columns - to display (4 by default).
- orderby - choose the way to sort your products. The argument’s values are similar to the ones in the products shortcode. You may choose one or multiple values (separated by space) from the list: title (by default), date (when the product was published), id (by the post ID of the product), menu_order (the lower the Menu Order number the higher the product will appear), popularity (by the number of purchases), rand (randomly show products, but may not work well with cache), and rating (by average product rating).
- order - set the order type: ASC (default) or DESC for the products ordering.
The last example from the WooCommerce shortcodes 😀 with product_category category="Food" limit="5" columns="5" orderby="rating":
You may test the WooCommerce shortcodes with their arguments and customize your store!
Bonus 1: WooCommerce Gutenberg blocks 🚀
WooCommerce integrated hugely with the Gutenberg editor giving you A LOT of pre-built blocks for your posts and pages ⭐. Sometimes, you may treat them as faster shortcodes as you just choose them from the list with a few clicks (no need to insert any shortcode parameters)😀.
Use the list to find ideas for your store and content creation process. I included blocks that generate content with existing products, categories, etc. (with screenshots 🎉).
Each WooCommerce block gives you functionality with an interesting layout. Try to insert each name to test them. In my opinion, Gutenberg blocks may be a great (and faster) alternative to WooCommerce shortcodes 💪! I’ll show you screenshots of my favorites 🙂!
Here comes the alphabetical list of selected blocks in the post/ page editor ⭐.
WooCommerce Blocks in the Gutenberg list
- Active Filters
- All Products
- All Reviews
- Best Selling Products
- Cart
- Checkout
- Classic Cart
- Classic Checkout
- Customer Account
- Featured Category
- Featured Product
- Featured Products 2 Columns
- Featured Products: 5 Columns
- Filter by Attribute
- Filter by Price
- Filter by Rating
- Filter by Stock
- Hand-picked Products
- Large Image Product Gallery
- Mini-Cart
- Minimal Product List
- Newest Products
- On Sale Products
- Product categories
- Product Categories List
- Product Collection (Beta)
- Product Collection Newest Arrivals
- Product Collection Rows
- Product Collection Simple Grid
- Product Details Product Listing
- Product Filters
- Product Gallery
- Product Hero
- Product List with Full Product Description
- Product List with 1:1 Images
- Product Price
- Product Search
- Product Summary
- Product tags
- Product Title
- Products (Beta)
- Products by Attribute
- Products by Category
- Products by Tag (useful & similar to Products by Attribute)
- Reviews by Category
- Reviews by Product
- Shop by Price
- Single Product
- Top Rated Products
- 4-Column Product Row
As you can see, some blocks can help you in showing products faster. There are also blocks with a new cart and checkout (a nice alternative to the default ones we get with WooCommerce shortcodes).
Bonus 2: WordPress shortcodes 🙂
WordPress lets you use the additional 6 shortcodes since Version 2.5. They are mainly shortcuts to get some media elements inside your posts or pages.
I have listed them here so that you know they exist - if you’d like to further customize your posts and pages beyond WooCommerce shortcodes and blocks 🚀.
WordPress shortcodes list
- audio
- caption
- embed
- gallery
- playlist
- video
Common issues & compatible WooCommerce plugins
There are 4 main reasons why shortcodes are not working properly 🙁. Let’s find out why.
WooCommerce shortcodes do not work - troubleshooting
- First, you may have put your shortcode name with a space after the opening [ or closing ].
- Next, the shortcode may be in the < pre > or < code > HTML tags (here with additional spaces).
- Check out if the “ character you use to declare the shortcode’s arguments (a.k.a. attrs or attributes) is like this attr="value" and not this attr=“value”.
- Finally, the shortcode may have encountered conflict with other plugins or your theme. To troubleshoot that possibility try to use the shortcode with WooCommerce only, and a default theme recommended by WooCommerce e.g. Storefront.
- Plugin compatibility check. If you install new plugins or a theme, try if the WooCommerce shortcodes work properly with them. If not, please contact the theme or plugin’s authors for assistance.
WooCommerce plugins
I will show you a few of our plugins that will integrate with WooCommerce shortcodes so that you can use their functionality calmly 😎.
You may check out WP Desk:
You can also try plugins in a free demo or contact us for more details 🙂.
Custom shortcodes in WordPress and WooCommerce
Many plugins and themes add their own shortcodes or let you customize them. The most common uses for them are banners, forms, messages, and special features for your site 💪.
You may add your shortcode with a custom plugin or directly to the theme’s functions.php file (in this case, remember to check the file after you update or change your theme) 🙂.
After using the shortcode in a post, visitors will see the new box with styling.
Custom shortcodes ideas
- Infobox
- Contact info
- Affiliate/ UTM helper
- Function execution
- and more
You may also decide you need a WooCommerce shortcodes plugin to help you with the task.
WooCommerce shortcodes summary (& free plugins)
Today, you’ve seen A LOT of WooCommerce shortcodes, Gutenberg blocks, and how to use them in your WordPress to give your store a boost 🚀. I have also shown you some issues and how to troubleshoot them.
Then, you’ve met some of our plugins that are beautifully compatible with WooCommerce shortcodes 😀.
Also, you’ve learned about different types of WooCommerce shortcodes (for the cart, checkout, products, login, or shop pages). You could've seen many practical examples with screenshots of how to add and use custom shortcodes in WordPress and WooCommerce 💪. We’ve come to the final words 🎉!
I encourage you to try WooCommerce shortcodes & blocks. Also, check out our premium extensions here but also free plugins in the WordPress repository (link below). If you have any questions let us know 🙂!
ShareSoft Technology says
WooCommerce impresses with its seamless functionality and user-friendly interface. Running my online store is a breeze, thanks to its powerful features and customizable options for a standout e-commerce experience
https://www.sharesoft.in/product/dynamic-pricing-and-discount-product/