WooCommerce Shortcodes

| Last Updated: | In: WooCommerce, WordPress


Hi folks, hope you are doing good. In today’s tutorial, I will explain about WooCommerce shortcodes. There are many WooCommerce shortcodes which you can use in the various condition in your WooCommerce based online store.

This tutorial is based on the latest version of WooCommerce and also I have tested all shortcodes in my demo WooCommerce store.

WooCommerce Page Shortcodes

In the most of the cases all shortcodes will be added to the page automatically during the WooCommerce onboarding wizard of WooCoomerce plugin, but if you have skipped the onboarding wizard then you can create the page manually and add the below shortcodes.

  • [woocommerce_cart] – shows the cart page
  • [woocommerce_checkout] – shows the checkout page
  • [woocommerce_order_tracking] – shows the order tracking form
  • [woocommerce_my_account] – shows the user account page

Recent Products

List the recent products from your store by using the below shortcode. You can change the per_page and columns parameters as per your requirements.

Featured Products

Use below shortcode to display the products that have been set as “featured and it will look like the recent products and also you can change the per_page and columns parameters as per your requirements.

Best Selling and Related Products

To display the best selling products and related products in any of your WordPress templates page use the below shortcodes.

Want to display the top customer’s rated products on the template page, then use the below shortcode.

Display Products by Ids and SKU

If you want to display the products using the product ids and SKU, then use the below shortcodes.

Product Attribute

List all products based on the product attribute shortcode.

How to sort products by custom meta Fields

If you want to add sorting features by custom meta fields like product price, then you can do by using the code snippets. In the below sample code we have done for the product price. Open your functions.php file from your current theme folder and add below code at the end of the file. You can customize the meta_key in below code as you want.

Thank you for giving time to FreeWebMentor community. I hope this tutorial help you, but if you need any help feel free to put your comments in below comment section. Do like & share this tutorial with your friends and also subscribe my blog to get the best tutorial directly in your email Inbox.


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies.


You may also like:


, , , , ,