Your Dedicated Partner for All Things WordPress

Table of Contents

WooCommerce is a popular solution for all shopping stores. This article will cover all the things about WooCommerce Shortcodes. We will see all the things you should know about shortcodes. We will go from basic to advance. Starting from what are WooCommerce shortcodes to the most advanced usages, we will cover all the things you should know about it.

After reading this article, you can easily add any shortcode and create the page you want.

Urgent WordPress Assistance

Facing a critical WordPress issue? Don’t panic. Our Emergency Service is here to swiftly resolve any urgent website problems.

What is WooCommerce Shortcodes?

Shortcodes might sound a little bit technical. However, there is nothing to worry about. It is not at all technical and you can use it with ease.

Shortcodes allow you to functionality on WordPress page and post without having to write the code. The shortcodes used for WooCommerce are known as WooCommerce shortcodes.

For example, if you want to display the cart in a particular post or page, you can use the shortcode to display it. You don’t need to write the entire code of the cart to display it.

We will be seeing which are the shortcodes and how you can use them effectively and wisely.

To use this shortcode, you simply need to copy the shortcode and paste it on the post, page, or at a place where the shortcode is placed.

Page Shortcode

To begin with, we will take a page shortcode first. These are the shortcodes used for a page. For example, if you talk about the WooCommerce cart, there is a different cart page. So, to display it, you will need to use the shortcode.

Let’s see some of the shortcodes.

[woocommerce_cart] – This is the shortcode that you can use to display the cart.

[woocommerce_checkout] – If you want to display the checkout page, you will need to use this checkout.

[woocommerce_order_tracking] – Order tracking is the place where the user can find the progress of the order. Whether their order is in process or it is out for delivery, all these things can be known by the order tracking.

Order tracking, WooCommerce shortcodes

[woocommerce_my_account] – If you want to display the user account information, you can use this particular shortcode.

These are some of the shortcodes you can use when it comes to WooCommerce page shortcodes. You can use any of the shortcodes on any page.

Instant WordPress Support

Get immediate assistance for your WordPress website with our on-demand support services.

Further, if you want to display two things on one page, you can do it too. For example, if you want to display the cart and checkout on one single page, you can paste both of these shortcodes into a single page. In such cases, both cart and the checkout will be on the same page. Of course, this is not recommended at all.

However, if you want, you can display the order tracking page on the My Account page, you can surely combine both of them.

WooCommerce Product Shortcodes

The next is the product shortcode. WooCommerce allows you to use product shortcodes on various pages. You can display all the products using the shortcode or you can display a specific set of products.

Further, it also allows you to set the parameters and then display the products.  To display the products, you can use [products] shortcode.

There are many tweaks you can do here. WooCommerce allows you to add many things in this shortcode. You can set the limit, you can set the category, etc. You can surely check out the WooCommerce documents for a complete list of the attributes and variations you can use.

However, we will surely see the most popular shortcode and their usage.

First, let’s talk about the common filters. Luckily, you don’t need to set any parameters for recent products or bestselling ones, WooCommerce allows you to add them directly.

Here are the shortcodes you can use.

  • [featured_products]
  • [sale_products]
  • [best_selling_products]
  • [recent_products]
  • [top_rated_products]

Of course, there is no extra information needed about the shortcode, right?

Talking about the featured products, you can set any product as a featured product from the product editing page. There will be an option to set the product as a featured product. You can use it and your work will be done.

Product Attributes

Now, if you want to display only specific products, you can use attributes. There are various attributes available. Just like the above section, we will see some of the popular attributes that most people will need. In most cases, you will use only these.

limit: Limit is used to set the product limit.

columns: When you are displaying the product, sometimes you will only need 1 or 2 columns, you can set it with this attribute.

orderby: If you want to display the best selling products first, you can do it. Further, you can also order by name, SKU, etc. There are various attributes allowed here. You can use date, id, popularity, date, etc.

category: It allows to set categories of the product. You can add more categories with the help of commas.

Now, let’s see the example of such a shortcode. This will give you an idea of how you can use it on various occasions.

If you want to display 4 products in 2 columns and only show the best selling products, you can use the following shortcode.

[products limit="4" columns="2" best_selling="true"]

If you want to display the newest products with the same column structure as stated above, you can use the following shortcode

[products limit="4" columns="2" orderby="id" order="DESC" visibility="visible"]

Let’s also see how you can display the product category wise.

[products limit="8" columns="4" category="books, ebooks" cat_operator="AND"]

Here is the shortcode to display products with specific attributes.

[product_attribute attribute='color' filter='blue']

You can check more information about the shortcode on the documentation page. Now, let’s see an easy way to add the shortcode and display the product in the right way.

The Shortcode Plugins

Now, the above shortcodes were easy to paste. But what if you want to display a particular set of products? Let’s say if you want to divide all the products category wise as well as you only want to see X number of products on a single page. What you will do in such a case? You will have to remember the shortcode.

We are here to either run the blog or run the business, no one has enough time to remember the shortcode. That’s why we will be using a plugin to display all the products. The plugin will help you to create the shortcode with ease.

There are many options here when you are choosing a plugin. Here is a shortlist of the best WooCommerce shortcodes plugins. You can use any of them. We suggest you try some of them and then choose the best one. This might vary depending on your needs.

If you don’t want to waste your time choosing a plugin, you can use anyone from the first 2.  The first one (WooCommerce shortcodes) is the best one. You can find most of these in the WordPress plugin directory for free. Further, if you want to use more features, you can surely go for the premium version.

We will now see how you can use these plugins and display all the shortcodes with ease.

How to use Shortcode Plugins?

Now, all the plugins work differently. So, it will not be possible to cover the tutorial of all the shortcodes plugins. However, we will see an overview of the plugins. Thereafter, you will be able to use most of these plugins with ease.

Let’s begin with one of the most favorite plugins. We will first see the information about WooCommerce shortcodes.

The WooCommerce shortcodes plugin is one of the easiest and most convenient plugins. All you have to do is install and activate the plugin. Thereafter, you just need to head over to the page. When you go to the create page option, you will see the plugin in the above bar.

If you are using TinyMCE, you will see the option in the top toolbar. In the same way, if you are using the Guttenberg editor, you will see the shortcode option in the block editing. Inside it, you will see various visual options.

For example, if you want to create a shortcode of a specific category, you can do it with ease. You will have to enter the id, category in the field box and then the plugin will automatically generate the shortcode for you. So, you don’t need to remember anything. This is the easiest way for things with ease.

The next plugin the Woo Shortcodes kit. This will increase the functionality of WooCommerce. Therefore, if you want to increase the functionality of the WooComemrce website, you will have to install such plugins.

Even if you can remember all the shortcodes, we highly recommend you use a plugin. As if you make the mistake in the shortcode, it will not show any product. It is always better to use a plugin instead.

Using Shortcodes Anywhere

Now, let’s get into the last topic which is to create the pages using WooCommerce shortcodes. We will also see how you can use the shortcode anywhere. You can use the shortcodes at many places including posts, pages, custom post types, etc.

All you have to do is paste the shortcode on the page/post and you are done. If you are using a plugin, you can simply click on the plugin options from the editor and your shortcode will be generated. You can cut/paste the shortcode anywhere on the page to move it. When you hit the preview button, it will show you the actual products rather than the shortcode.

In simpler words, the shortcode is used to display the code anywhere.

Did we just mention “anywhere”? But, if you type the shortcode in the widget section, it will not display anything rather it will just display the shortcode only. So, you can’t directly use a shortcode in the widget. However, there is a method to use the shortcode anywhere on your WordPress website. Let’s see more about it and how you can use it.

Shortcode Anywhere or Everywhere

There is a free plugin called “Shortcodes Anywhere or Everywhere”. This will allow you to add the shortcodes anywhere you want. It is a free plugin and you can get in the WordPress plugin directory itself.

With the help of anywhere shortcode, you can use the shortcode in the widget, post title, excerpts, etc. You can’t add the shortcode in the title without using this plugin.

This plugin will not be required by everyone. If you want to display the products in the widget, you can directly add it from the WooCommerce widgets only. However, if you want to display the products via a shortcode, you will need this plugin. So, this is not one of the must-have plugins. If you have such a requirement to add the shortcode at someplace where it is not supported, you can surely use this plugin.

Other than this, if you are using a builder to build pages and the shortcode is not supported, you can use this plugin. Also, there will be the builder specific shortcode plugin which is mostly used for the particular builder, you can use it too.

Final Words

To conclude, this was all about WooCommerce shortcodes and how you can use it. If you want more functionalities in the shortcode, you will surely have to take the help of the plugins. It will make your work easier. If you don’t want to use plugins, you can have a look at the WooCommerce documentation and see what are the things you can do with the shortcodes. The plugin is only recommended for the people who want to use the shortcodes often. If you only want to use it once a while, we recommend you to use it manually rather than a plugin. A plugin will take more load. So, if you don’t want to use it often, you can check out the documentation and add the shortcode manually.

Tailored WordPress Solutions

Elevate your online presence with our custom WordPress development services.

How to get started?

Learn more

WooCommerce Maintenance

Save 33% with our Annual pricing plan.

Get Started

Coupon Code Applied!

Take your time and continue browsing our services.

Alexey Seryapin
Founder of WPServices